本文整理汇总了Java中net.minecraft.client.renderer.RenderBlocks.setRenderBoundsFromBlock方法的典型用法代码示例。如果您正苦于以下问题:Java RenderBlocks.setRenderBoundsFromBlock方法的具体用法?Java RenderBlocks.setRenderBoundsFromBlock怎么用?Java RenderBlocks.setRenderBoundsFromBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.RenderBlocks
的用法示例。
在下文中一共展示了RenderBlocks.setRenderBoundsFromBlock方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例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: 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();
}
示例4: renderWorldBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
private boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, BlockInfusedBlockOre block, int modelId,
RenderBlocks renderer) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block.getBaseBlock(), x, y, z);
renderer.clearOverrideBlockTexture();
return true;
}
示例5: renderItem
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
if (!(item.getItem() instanceof ItemBlock)) {
return;
}
final Block block = ((ItemBlock)item.getItem()).field_150939_a;
if (block == null) {
return;
}
final RenderBlocks renderer = (RenderBlocks)data[0];
Entity holder = null;
if (data.length > 1 && data[1] instanceof Entity) {
holder = (Entity)data[1];
}
if (holder == null) {
holder = (Entity)Minecraft.getMinecraft().thePlayer;
}
final Tessellator var4 = Tessellator.instance;
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
switch (type) {
case EQUIPPED:
case EQUIPPED_FIRST_PERSON: {
GL11.glTranslatef(-1.0f, 0.5f, 0.0f);
break;
}
default: {
GL11.glTranslatef(-0.5f, -0.0f, -0.5f);
break;
}
}
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glEnable(3008);
RenderBlockDrum.drawInvBlock(block, item);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glTranslatef(0.5f, 0.0f, 0.5f);
}
示例6: 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);
}
示例7: 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.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
final boolean isBreaking = renderer.hasOverrideBlockTexture();
if (!isBreaking) renderer.setOverrideBlockTexture(BlockPIM.iIcon1);
final boolean hasPlayer = hasPlayer(world, x, y, z);
setTopPartBounds(renderer, hasPlayer);
renderer.renderStandardBlock(block, x, y, z);
if (!isBreaking) renderer.clearOverrideBlockTexture();
return true;
}
示例8: 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);
float f = 1.0f;
float f2 = 1.0f;
float f3 = 1.0f;
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;
}
GL11.glColor4f(f, f2, f3, 1.0f);
renderer.colorRedTopLeft *= f;
renderer.colorRedTopRight *= f;
renderer.colorRedBottomLeft *= f;
renderer.colorRedBottomRight *= f;
renderer.colorGreenTopLeft *= f2;
renderer.colorGreenTopRight *= f2;
renderer.colorGreenBottomLeft *= f2;
renderer.colorGreenBottomRight *= f2;
renderer.colorBlueTopLeft *= f3;
renderer.colorBlueTopRight *= f3;
renderer.colorBlueBottomLeft *= f3;
renderer.colorBlueBottomRight *= f3;
if (block.getIcon(0, metadata) == null) {
return;
}
var4.startDrawingQuads();
var4.setNormal(0.0f, -1.0f, 0.0f);
renderer.renderFaceYNeg(block, 0.0, -0.5, 0.0, block.getIcon(0, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 1.0f, 0.0f);
renderer.renderFaceYPos(block, 0.0, -0.5, 0.0, block.getIcon(1, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, -1.0f);
renderer.renderFaceXPos(block, 0.0, -0.5, 0.0, block.getIcon(2, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, 1.0f);
renderer.renderFaceXNeg(block, 0.0, -0.5, 0.0, block.getIcon(3, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(-1.0f, 0.0f, 0.0f);
renderer.renderFaceZNeg(block, 0.0, -0.5, 0.0, block.getIcon(4, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(1.0f, 0.0f, 0.0f);
renderer.renderFaceZPos(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);
}
示例9: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
if (!(block instanceof IMultiBoxBlock)) {
return;
}
final BoxModel boxes = ((IMultiBoxBlock)block).getInventoryModel(metadata);
if (boxes == null) {
return;
}
if (boxes.size() == 0) {
return;
}
((IMultiBoxBlock)block).prepareForRender(boxes.label);
final Box union = boxes.boundingBox();
final float dx = (union.maxX + union.minX) / 2.0f - 0.5f;
final float dy = (union.maxY + union.minY) / 2.0f - 0.5f;
final float dz = (union.maxZ + union.minZ) / 2.0f - 0.5f;
GL11.glTranslatef(-dx, -dy, -dz);
GL11.glRotatef((float)boxes.invModelRotate, 0.0f, 1.0f, 0.0f);
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
for (final Box b : boxes) {
block.setBlockBounds(b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ);
((IMultiBoxBlock)block).prepareForRender(b.label);
final Tessellator tessellator = Tessellator.instance;
renderer.setRenderBoundsFromBlock(block);
GL11.glColor3f((b.color >> 16 & 0xFF) / 255.0f, (b.color >> 8 & 0xFF) / 255.0f, (b.color & 0xFF) / 255.0f);
renderer.uvRotateEast = b.uvRotateEast;
renderer.uvRotateWest = b.uvRotateWest;
renderer.uvRotateSouth = b.uvRotateSouth;
renderer.uvRotateNorth = b.uvRotateNorth;
renderer.uvRotateTop = b.uvRotateTop;
renderer.uvRotateBottom = b.uvRotateBottom;
if (!b.invisibleSide[0]) {
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, -1.0f, 0.0f);
renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 0, metadata));
tessellator.draw();
}
if (!b.invisibleSide[1]) {
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 1.0f, 0.0f);
renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 1, metadata));
tessellator.draw();
}
if (!b.invisibleSide[2]) {
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0f, 0.0f, 0.0f);
renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 2, metadata));
tessellator.draw();
}
if (!b.invisibleSide[3]) {
tessellator.startDrawingQuads();
tessellator.setNormal(1.0f, 0.0f, 0.0f);
renderer.flipTexture = true;
renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 3, metadata));
renderer.flipTexture = false;
tessellator.draw();
}
if (!b.invisibleSide[4]) {
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 0.0f, -1.0f);
renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 4, metadata));
tessellator.draw();
}
if (!b.invisibleSide[5]) {
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 0.0f, 1.0f);
renderer.flipTexture = true;
renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, this.getTexture(null, 0, 0, 0, renderer, b, block, 5, metadata));
renderer.flipTexture = false;
tessellator.draw();
}
renderer.uvRotateEast = 0;
renderer.uvRotateWest = 0;
renderer.uvRotateSouth = 0;
renderer.uvRotateNorth = 0;
renderer.uvRotateTop = 0;
renderer.uvRotateBottom = 0;
}
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
GL11.glTranslatef(dx, dy, dz);
}
示例10: renderWorldBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
final int metadata = world.getBlockMetadata(x, y, z);
if (!(block instanceof IMultiBoxBlock)) {
return false;
}
final BoxModel boxes = ((IMultiBoxBlock)block).getWorldModel(world, x, y, z);
if (boxes == null || boxes.size() == 0) {
return false;
}
((IMultiBoxBlock)block).prepareForRender(boxes.label);
for (final Box b1 : boxes) {
final float r = (b1.color >> 16 & 0xFF) / 255.0f;
final float g = (b1.color >> 8 & 0xFF) / 255.0f;
final float b2 = (b1.color & 0xFF) / 255.0f;
((IMultiBoxBlock)block).prepareForRender(b1.label);
block.setBlockBounds(b1.minX, b1.minY, b1.minZ, b1.maxX, b1.maxY, b1.maxZ);
renderer.uvRotateEast = b1.uvRotateEast;
renderer.uvRotateWest = b1.uvRotateWest;
renderer.uvRotateSouth = b1.uvRotateSouth;
renderer.uvRotateNorth = b1.uvRotateNorth;
renderer.uvRotateTop = b1.uvRotateTop;
renderer.uvRotateBottom = b1.uvRotateBottom;
renderer.setRenderBoundsFromBlock(block);
if (b1.renderAsNormalBlock) {
renderer.renderStandardBlock(block, x + b1.offsetx, y + b1.offsety, z + b1.offsetz);
}
else {
renderer.enableAO = false;
final Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x + b1.offsetx, y + b1.offsety, z + b1.offsetz));
tessellator.setColorOpaque_F(r * 0.5f, g * 0.5f, b2 * 0.5f);
renderer.flipTexture = false;
if (!b1.invisibleSide[0]) {
renderer.renderFaceYNeg(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 0, metadata));
}
tessellator.setColorOpaque_F(r, g, b2);
if (!b1.invisibleSide[1]) {
renderer.renderFaceYPos(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 1, metadata));
}
tessellator.setColorOpaque_F(r * 0.8f, g * 0.8f, b2 * 0.8f);
renderer.flipTexture = true;
if (!b1.invisibleSide[2]) {
renderer.renderFaceZNeg(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 2, metadata));
}
renderer.flipTexture = false;
if (!b1.invisibleSide[3]) {
renderer.renderFaceZPos(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 3, metadata));
}
tessellator.setColorOpaque_F(r * 0.6f, g * 0.6f, b2 * 0.6f);
if (!b1.invisibleSide[4]) {
renderer.renderFaceXNeg(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 4, metadata));
}
renderer.flipTexture = true;
if (!b1.invisibleSide[5]) {
renderer.renderFaceXPos(block, (double)(x + b1.offsetx), (double)(y + b1.offsety), (double)(z + b1.offsetz), this.getTexture(world, x, y, z, renderer, b1, block, 5, metadata));
}
renderer.flipTexture = false;
}
renderer.uvRotateBottom = 0;
renderer.uvRotateTop = 0;
renderer.uvRotateSouth = 0;
renderer.uvRotateNorth = 0;
renderer.uvRotateWest = 0;
renderer.uvRotateEast = 0;
}
block.setBlockBoundsBasedOnState(world, x, y, z);
return true;
}
示例11: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public void renderInventoryBlock(final Block block, 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);
if (metadata >= 16 || metadata < 0) {
metadata = this.rand.nextInt(16);
}
float f = BlockColor.initColor[metadata][0];
float f2 = BlockColor.initColor[metadata][1];
float f3 = BlockColor.initColor[metadata][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;
}
GL11.glColor4f(f, f2, f3, 1.0f);
renderer.colorRedTopLeft *= f;
renderer.colorRedTopRight *= f;
renderer.colorRedBottomLeft *= f;
renderer.colorRedBottomRight *= f;
renderer.colorGreenTopLeft *= f2;
renderer.colorGreenTopRight *= f2;
renderer.colorGreenBottomLeft *= f2;
renderer.colorGreenBottomRight *= f2;
renderer.colorBlueTopLeft *= f3;
renderer.colorBlueTopRight *= f3;
renderer.colorBlueBottomLeft *= f3;
renderer.colorBlueBottomRight *= f3;
var4.startDrawingQuads();
var4.setNormal(0.0f, -1.0f, 0.0f);
renderer.renderFaceYNeg(block, 0.0, -0.5, 0.0, block.getIcon(0, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 1.0f, 0.0f);
renderer.renderFaceYPos(block, 0.0, -0.5, 0.0, block.getIcon(1, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, -1.0f);
renderer.renderFaceXPos(block, 0.0, -0.5, 0.0, block.getIcon(2, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, 1.0f);
renderer.renderFaceXNeg(block, 0.0, -0.5, 0.0, block.getIcon(3, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(-1.0f, 0.0f, 0.0f);
renderer.renderFaceZNeg(block, 0.0, -0.5, 0.0, block.getIcon(4, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(1.0f, 0.0f, 0.0f);
renderer.renderFaceZPos(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);
}
示例12: 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();
double offset = 1 - 0.124;
double ooffset = -offset;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, offset, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, ooffset, 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, offset, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, ooffset, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, offset, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, ooffset, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例13: renderInventoryBlock
import net.minecraft.client.renderer.RenderBlocks; //导入方法依赖的package包/类
public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int colorMultiplier, Set<ForgeDirection> enabledSides) {
block.setBlockBoundsForItemRender();
renderer.setRenderBoundsFromBlock(block);
renderInventoryBlockNoBounds(renderer, block, metadata, colorMultiplier, enabledSides);
}