当前位置: 首页>>代码示例>>Java>>正文


Java RenderBlocks类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks类的具体用法?Java RenderBlocks怎么用?Java RenderBlocks使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RenderBlocks类属于net.minecraft.client.renderer包,在下文中一共展示了RenderBlocks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderItem

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	
	RenderBlocks renderblocks = (RenderBlocks) data[0];
	Block block = Block.getBlockFromItem(item.getItem());
	if (item.hasTagCompound()) {
		NBTTagCompound tag = item.stackTagCompound;
		if (tag.hasKey("Fluid")) {
			FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("Fluid"));
			if (liquid != null) {
				GL11.glEnable(GL11.GL_BLEND);
				float height = ((float) liquid.amount / (float) 8000 * (float) 0.99);
				renderblocks.setRenderBounds(0.01, 0.01, 0.01, 0.99, height, 0.99);
				Utils.renderInventoryBlock(renderblocks, GrandFluidTank.renderblocks, liquid.getFluid());
				GL11.glDisable(GL11.GL_BLEND);
			}
		}

		GL11.glEnable(GL11.GL_ALPHA_TEST);
		renderblocks.setRenderBounds(0, 0, 0, 1, 1, 1);
		Utils.renderInventoryBlock(renderblocks, block, GrandFluidTank.glassfluidtank.getIcon(0, 0));
		GL11.glDisable(GL11.GL_ALPHA_TEST);

	}
}
 
开发者ID:grand-mine-inc,项目名称:Steam-and-Steel,代码行数:26,代码来源:RenderItemBlockGlassTank.java

示例2: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	if (modelId == renderID) {
		TileGlassFluidTank tank = (TileGlassFluidTank) world.getTileEntity(x, y, z);
		if (renderPass == 0) {
			if (tank.tank.getFluid() != null) {
				Fluid fluid = tank.tank.getFluid().getFluid();
				Utils.renderBlockByCompleteness(GrandFluidTank.renderblocks,fluid, world.getBlockMetadata(x, y, z), renderer, (double) tank.tank.getFluidAmount() / (double) tank.tank.getCapacity(), x, y, z);
			}
		}
		else if (renderPass == 1) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderStandardBlock(block, x, y, z);
			renderer.setRenderFromInside(true);
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderStandardBlock(block, x, y, z);
			renderer.setRenderFromInside(false);
		}
	}
	return true;
}
 
开发者ID:grand-mine-inc,项目名称:Steam-and-Steel,代码行数:22,代码来源:RenderGlassTank.java

示例3: renderInventoryBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
	OpenGLHelper.translate(-0.5F, -0.5F, -0.5F);

	renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:18,代码来源:BlockChorusFlowerRender.java

示例4: renderCube

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
private void renderCube(RenderBlocks renderer, Block block, int meta) {
	Tessellator tessellator = Tessellator.instance;
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:18,代码来源:BlockChorusFlowerRender.java

示例5: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	renderer.renderAllFaces = true;

	renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.renderAllFaces = false;
	return true;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:26,代码来源:BlockChorusFlowerRender.java

示例6: renderInventoryBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	block.setBlockBounds(0.005F, 0.005F, 0.005F, 0.995F, 0.995F, 0.995F);
	renderer.setRenderBoundsFromBlock(block);

	if (metadata < 6) {
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[0], ((BlockInfusedBlockOre) block).icon[1],
				((BlockInfusedBlockOre) block).icon[2], ((BlockInfusedBlockOre) block).icon[3],
				((BlockInfusedBlockOre) block).icon[4], ((BlockInfusedBlockOre) block).icon[5], false);
		Color c = new Color(BlockCustomOreItem.colors[metadata + 1]);
		float r = c.getRed() / 255.0F;
		float g = c.getGreen() / 255.0F;
		float b = c.getBlue() / 255.0F;
		GL11.glColor3f(r, g, b);
		block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
		renderer.setRenderBoundsFromBlock(block);
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[6], false);
		GL11.glColor3f(1.0F, 1.0F, 1.0F);
	}
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:21,代码来源:BlockInfusedBlockOreRenderer.java

示例7: renderInventoryBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
    final Tessellator var4 = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    renderer.setRenderBoundsFromBlock(block);
    GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
    GL11.glTranslatef(-0.5f, -0.0f, -0.5f);
    final int l = block.getRenderColor(metadata);
    final float r = (l >> 16 & 0xFF) / 255.0f;
    final float g = (l >> 8 & 0xFF) / 255.0f;
    final float b = (l & 0xFF) / 255.0f;
    GL11.glColor4f(r, g, b, 1.0f);
    GL11.glDisable(2896);
    renderer.enableAO = false;
    var4.startDrawingQuads();
    var4.setNormal(0.0f, 1.0f, 0.0f);
    renderer.renderFaceYNeg(block, 0.0, -0.5, 0.0, block.getIcon(0, metadata));
    renderer.renderFaceYPos(block, 0.0, -0.5, 0.0, block.getIcon(1, metadata));
    renderer.renderFaceZNeg(block, 0.0, -0.5, 0.0, block.getIcon(2, metadata));
    renderer.renderFaceZPos(block, 0.0, -0.5, 0.0, block.getIcon(3, metadata));
    renderer.renderFaceXNeg(block, 0.0, -0.5, 0.0, block.getIcon(4, metadata));
    renderer.renderFaceXPos(block, 0.0, -0.5, 0.0, block.getIcon(5, metadata));
    var4.draw();
    GL11.glTranslatef(0.5f, 0.0f, 0.5f);
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(2896);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:27,代码来源:RenderBlockFullBright.java

示例8: renderWorldBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
    final Tessellator var8 = Tessellator.instance;
    final int i = world.getBlockMetadata(par2, par3, par4);
    float f = BlockColor.initColor[i][0];
    float f2 = BlockColor.initColor[i][1];
    float f3 = BlockColor.initColor[i][2];
    final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
    if (data instanceof TileEntityBlockColorData) {
        f = ((TileEntityBlockColorData)data).palette[i][0];
        f2 = ((TileEntityBlockColorData)data).palette[i][1];
        f3 = ((TileEntityBlockColorData)data).palette[i][2];
    }
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:23,代码来源:RenderBlockColor.java

示例9: renderCryogenicChamber

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
private void renderCryogenicChamber(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();

    this.transform(type);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(ItemRendererMachine.chamberTexture0);
    this.model.renderPart("Main_Cylinder");

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0.1F, 0.6F, 0.5F, 0.4F);

    this.model.renderPart("Shield_Torus");

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:ItemRendererMachine.java

示例10: renderFluid

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public void renderFluid(float f5)
 {
 	if(hasFluid && hasJug)
 	{
 		GL11.glPushMatrix();
 		GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
 		GL11.glEnable(GL11.GL_CULL_FACE);
 		GL11.glDisable(GL11.GL_LIGHTING);
 		GL11.glEnable(GL11.GL_BLEND);
 		GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
 		float scale = 0.5F;
 		GL11.glScalef(scale, scale, scale);
 		GL11.glTranslatef(0f, 2.0F, 0f);

 		Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
      
  	RenderBlocks renderBlocks = RenderBlocks.getInstance();
      renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
      renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);

      renderBlocks.clearOverrideBlockTexture();

GL11.glPopAttrib();
GL11.glPopMatrix();
 	}
 }
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:27,代码来源:ModelCampfire.java

示例11: renderBlockMeteor

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
    float f = 1.0F;
    int l = par1Block.colorMultiplier(var1, par2, par3, par4);
    float f1 = (l >> 16 & 255) / 255.0F;
    float f2 = (l >> 8 & 255) / 255.0F;
    float f3 = (l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f4;
        f2 = f5;
        f3 = f6;
    }

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:BlockRendererCavernousVines.java

示例12: renderInvNormalBlock

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public static void renderInvNormalBlock(RenderBlocks renderBlocks, Block par1Block, int var2)
{
    renderBlocks.setRenderBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.5F, 0.8F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.52F, 0.0F, 0.4F, 0.68F, 0.68F, 0.6F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.65F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.15F, 0.0F, 0.25F, 0.2F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.8F, 0.0F, 0.25F, 0.85F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.1F, 0.75F, 0.4F, 0.2F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.8F, 0.75F, 0.4F, 0.9F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.clearOverrideBlockTexture();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:BlockRendererEgg.java

示例13: renderMachineInWorld

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
public void renderMachineInWorld(RenderBlocks renderBlocks, IBlockAccess iblockaccess, Block par1Block, int x, int y, int z)
{
    par1Block.setBlockBoundsBasedOnState(iblockaccess, x, y, z);
    renderBlocks.setRenderBoundsFromBlock(par1Block);

    int metadata = iblockaccess.getBlockMetadata(x, y, z) & 12;

    if (metadata == BlockMachineMars.CRYOGENIC_CHAMBER_METADATA && par1Block == MarsBlocks.machine)
    {

    }
    else
    {
        renderBlocks.renderStandardBlock(par1Block, x, y, z);
    }

    renderBlocks.clearOverrideBlockTexture();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockRendererMachine.java

示例14: renderItem

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:ItemRendererTier3Rocket.java

示例15: renderItem

import net.minecraft.client.renderer.RenderBlocks; //导入依赖的package包/类
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:ItemRendererShortRangeTelepad.java


注:本文中的net.minecraft.client.renderer.RenderBlocks类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。