本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks.renderFaceYPos方法的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks.renderFaceYPos方法的具体用法?Java RenderBlocks.renderFaceYPos怎么用?Java RenderBlocks.renderFaceYPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.RenderBlocks
的用法示例。
在下文中一共展示了RenderBlocks.renderFaceYPos方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
示例3: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, IIcon icon) {
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例4: renderInvBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
private static void renderInvBlock(Block block, RenderBlocks renderer)
{
Tessellator var14 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
var14.startDrawingQuads();
var14.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0));
var14.draw();
var14.startDrawingQuads();
var14.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, 0));
var14.draw();
var14.startDrawingQuads();
var14.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, 0));
var14.draw();
var14.startDrawingQuads();
var14.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, 0));
var14.draw();
var14.startDrawingQuads();
var14.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, 0));
var14.draw();
var14.startDrawingQuads();
var14.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, 0));
var14.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例5: 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) {
renderer.enableAO = false;
final Tessellator tessellator = Tessellator.instance;
boolean flag = false;
tessellator.setColorOpaque_F(1.0f, 1.0f, 1.0f);
tessellator.setBrightness(240);
final int meta = world.getBlockMetadata(par2, par3, par4);
final int l = par1Block.getRenderColor(meta);
final float r = (l >> 16 & 0xFF) / 255.0f;
final float g = (l >> 8 & 0xFF) / 255.0f;
final float b = (l & 0xFF) / 255.0f;
tessellator.setColorOpaque_F(r, g, b);
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2, par3 - 1, par4, 0)) {
renderer.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 0));
flag = true;
}
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2, par3 + 1, par4, 1)) {
renderer.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 1));
flag = true;
}
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2, par3, par4 - 1, 2)) {
renderer.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 2));
flag = true;
}
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2, par3, par4 + 1, 3)) {
renderer.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 3));
flag = true;
}
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2 - 1, par3, par4, 4)) {
renderer.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 4));
flag = true;
}
if (renderer.renderAllFaces || par1Block.shouldSideBeRendered(renderer.blockAccess, par2 + 1, par3, par4, 5)) {
renderer.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 5));
flag = true;
}
return flag;
}
示例6: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
final float minSize = 0.4F;
final float maxSize = 0.6F;
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
renderer.setRenderBounds(minSize, minSize, 0.0F, maxSize, maxSize, 1.0F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, metadata));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
var3.draw();
}
示例7: renderStandardBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
private static void renderStandardBlock(RenderBlocks var0, Block var1, int var2)
{
GL11.glPushMatrix();
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -1.0F, 0.0F);
var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 1.0F, 0.0F);
var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -1.0F);
var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 1.0F);
var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-1.0F, 0.0F, 0.0F);
var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(1.0F, 0.0F, 0.0F);
var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
var3.draw();
GL11.glPopMatrix();
}
示例8: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
Tessellator tessellator = Tessellator.instance;
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例9: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, -0.1D, 0.0D, block.getIcon(3, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, -0.1D, 0.0D, block.getIcon(2, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, -0.1D, 0.0D, block.getIcon(1, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, -0.1D, 0.0D, block.getIcon(0, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, -0.1D, 0.0D, block.getIcon(4, 0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, -0.1D, 0.0D, block.getIcon(5, 0));
tessellator.draw();
}
示例10: renderInvNormalBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderInvNormalBlock(RenderBlocks var0, Block var1, int var2)
{
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var0.setRenderBounds(0.0F, 0.0F, 0.0F, 1F, 1F, 1F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -0.8F, 0.0F);
var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.8F, 0.0F);
var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -0.8F);
var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 0.8F);
var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-0.8F, 0.0F, 0.0F);
var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.8F, 0.0F, 0.0F);
var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
var3.draw();
}
示例11: renderInvNormalBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderInvNormalBlock(RenderBlocks var0, Block var1, int var2)
{
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var0.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -1.0F, 0.0F);
var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 1.0F, 0.0F);
var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -1.0F);
var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 1.0F);
var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-1.0F, 0.0F, 0.0F);
var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(1.0F, 0.0F, 0.0F);
var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
var3.draw();
}
示例12: renderInvNormalBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderInvNormalBlock(RenderBlocks var0, Block var1, int var2)
{
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var0.setRenderBounds(0.15F, 0.15F, 0.15F, 0.85F, 0.85F, 0.85F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -0.8F, 0.0F);
var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.8F, 0.0F);
var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -0.8F);
var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 0.8F);
var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-0.8F, 0.0F, 0.0F);
var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.8F, 0.0F, 0.0F);
var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
var3.draw();
}
示例13: renderInvBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
private void renderInvBlock(Block block, RenderBlocks renderer, IIcon icon)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例14: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
OpenGLHelper.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
OpenGLHelper.enableBlend();
OpenGLHelper.translate(-0.5F, -0.5F, -0.5F);
float f = 0.0625F;
renderer.setRenderBounds(f * 3, f * 3, f * 3, f * 13, f * 13, f * 13);
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();
renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
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();
OpenGLHelper.translate(0.5F, 0.5F, 0.5F);
OpenGLHelper.disableBlend();
}
示例15: 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) {
Tessellator tessellator = Tessellator.instance;
int meta = world.getBlockMetadata(x, y, z);
if ((meta & 8) != 0) {
if (world.getBlock(x, y - 1, z) != block)
return false;
} else if (world.getBlock(x, y + 1, z) != block)
return false;
int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
tessellator.setBrightness(renderer.renderMinY > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y - 1, z));
tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F);
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 0));
if ((meta & 8) != 0) {
tessellator.setBrightness(renderer.renderMaxY < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y + 1, z));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
renderer.uvRotateTop = 2;
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 1));
renderer.uvRotateTop = 0;
}
tessellator.setBrightness(renderer.renderMinZ > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z - 1));
tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 2));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z + 1));
tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 3));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMinX > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x - 1, y, z));
tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 4));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMaxX < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x + 1, y, z));
tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 5));
renderer.flipTexture = false;
return true;
}