this.iconProvider = iconProvider;
}
@Override
public void renderBlock(RenderBlocks renderblocks, IBlockAccess iBlockAccess, int x, int y, int z, Block block) {
TileBoxBase tile = (TileBoxBase) iBlockAccess.getTileEntity(x, y, z);
float pix = RenderTools.PIXEL;
if (renderblocks.hasOverrideBlockTexture())
info.override = renderblocks.overrideBlockTexture;
else
info.override = null;
info.texture[0] = BlockSignalRailcraft.texturesBox[2];
info.texture[1] = iconProvider.getIcon();
info.texture[2] = BlockSignalRailcraft.texturesBox[0];
info.texture[3] = BlockSignalRailcraft.texturesBox[0];
info.texture[4] = BlockSignalRailcraft.texturesBox[0];
info.texture[5] = BlockSignalRailcraft.texturesBox[0];
// info.setBlockBounds(pix, 13 * pix, pix, 15 * pix, 15 * pix, 15 * pix);
// RenderFakeBlock.renderBlock(info, iBlockAccess, x, y, z, true, false);
boolean eastWest = false;
boolean northSouth = false;
if (tile.isConnected(EAST) || tile.isConnected(WEST))
eastWest = true;
if (tile.isConnected(NORTH) || tile.isConnected(SOUTH))
northSouth = true;
boolean side2 = tile.isConnected(NORTH);
boolean side3 = tile.isConnected(SOUTH);
boolean side4 = tile.isConnected(WEST);
boolean side5 = tile.isConnected(EAST);
if (!eastWest && !northSouth)
eastWest = true;
if (side2)
info.texture[2] = BlockSignalRailcraft.texturesBox[1];
if (side3)
info.texture[3] = BlockSignalRailcraft.texturesBox[1];
if (side4)
info.texture[4] = BlockSignalRailcraft.texturesBox[1];
if (side5)
info.texture[5] = BlockSignalRailcraft.texturesBox[1];
info.setBlockBounds(2 * pix, 0, 2 * pix, 14 * pix, 15 * pix, 14 * pix);
RenderFakeBlock.renderBlock(info, iBlockAccess, x, y, z, true, false);
info.renderSide[0] = false;
info.renderSide[1] = false;
// Aspect
for (int side = 2; side < 6; side++) {
SignalAspect aspect = tile.getBoxSignalAspect(ForgeDirection.getOrientation(side));
if (!aspect.isLit())
aspect = SignalAspect.OFF;
IIcon lamp = BlockSignalRailcraft.texturesLampBox[aspect.getTextureIndex()];
info.texture[2] = lamp;
info.texture[3] = lamp;