本文整理汇总了Java中net.minecraft.block.BlockHopper.getHopperIcon方法的典型用法代码示例。如果您正苦于以下问题:Java BlockHopper.getHopperIcon方法的具体用法?Java BlockHopper.getHopperIcon怎么用?Java BlockHopper.getHopperIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockHopper
的用法示例。
在下文中一共展示了BlockHopper.getHopperIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderSubBlock
import net.minecraft.block.BlockHopper; //导入方法依赖的package包/类
private void renderSubBlock(int x, int y, int z, @Nonnull AbstractMachineEntity te, @Nonnull TankSlot tankSlot) {
IIcon icon_outside = BlockHopper.getHopperIcon("hopper_outside");
IIcon icon_inside = BlockHopper.getHopperIcon("hopper_inside");
IIcon icon_top = Blocks.hopper.getIcon(1, 0);
int[] pos = frameRenderer.translateToSlotPosition(notnull(te.getFacingDir(), "Internal state error: Block is not facing any direction"), tankSlot);
// top box
BoundingBox bb1 = makePartialBBofSlot(0, 10, 0, 16, 16, 16, pos, x, y, z);
renderSingleFace(bb1, ForgeDirection.UP, icon_top, 0, 16, 0, 16, null, FaceRenderer.stdBrightness, false);
renderSkirt(bb1, icon_outside, 0, 16, 10, 16, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb1, ForgeDirection.DOWN, icon_outside, 0, 16, 0, 16, null, FaceRenderer.stdBrightness, false);
// inside
BoundingBox bb2 = makePartialBBofSlot(2, 10, 2, 14, 16, 14, pos, x, y, z);
renderSkirt(bb2, icon_outside, 2, 14, 10, 16, null, FaceRenderer.stdBrightnessInside, true);
renderSingleFace(bb2, ForgeDirection.DOWN, icon_inside, 2, 14, 2, 14, null, FaceRenderer.stdBrightnessInside, true);
// center box
BoundingBox bb3 = makePartialBBofSlot(4, 4, 4, 12, 10, 12, pos, x, y, z);
renderSkirt(bb3, icon_outside, 4, 12, 4, 10, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb3, ForgeDirection.DOWN, icon_outside, 4, 12, 4, 12, null, FaceRenderer.stdBrightness, false);
// connector
ForgeDirection cdir = getConnectorDirection(notnull(te.getFacingDir(), "Internal state error: Block is not facing any direction"), tankSlot);
int x0, x1, y0, y1, z0, z1;
switch (cdir) {
case NORTH:
x0 = 6;
y0 = 4;
z0 = 12;
x1 = 10;
y1 = 8;
z1 = 16;
break;
case SOUTH:
x0 = 6;
y0 = 4;
z0 = 0;
x1 = 10;
y1 = 8;
z1 = 4;
break;
case EAST:
x0 = 12;
y0 = 4;
z0 = 6;
x1 = 16;
y1 = 8;
z1 = 10;
break;
case WEST:
x0 = 0;
y0 = 4;
z0 = 6;
x1 = 4;
y1 = 8;
z1 = 10;
break;
case DOWN:
x0 = 6;
y0 = 0;
z0 = 6;
x1 = 10;
y1 = 4;
z1 = 10;
break;
default:
return;
}
BoundingBox bb4 = makePartialBBofSlot(x0, y0, z0, x1, y1, z1, pos, x, y, z);
renderSingleFace(bb4, ForgeDirection.UP, icon_outside, x0, x1, z0, z1, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb4, ForgeDirection.NORTH, icon_outside, x0, x1, y0, y1, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb4, ForgeDirection.SOUTH, icon_outside, x0, x1, y0, y1, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb4, ForgeDirection.EAST, icon_outside, z0, z1, y0, y1, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb4, ForgeDirection.WEST, icon_outside, z0, z1, y0, y1, null, FaceRenderer.stdBrightness, false);
renderSingleFace(bb4, ForgeDirection.DOWN, icon_outside, x0, x1, z0, z1, null, FaceRenderer.stdBrightness, false);
}