if ( tw != null )
{
hasChan = (tw.clientFlags & (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG)) == (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG);
hasPower = (tw.clientFlags & TileWireless.POWERED_FLAG) == TileWireless.POWERED_FLAG;
BlockRenderInfo ri = blk.getRendererInstance();
ForgeDirection fdy = tw.getUp();
ForgeDirection fdz = tw.getForward();
ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite();
renderer.renderAllFaces = true;
IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r );
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
super.renderInWorld( blk, world, x, y, z, renderer );
r = CableBusTextures.PartWirelessSides.getIcon();
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz );
super.renderInWorld( blk, world, x, y, z, renderer );
centerX = x;
centerY = y;
centerZ = z;
ri.setTemporaryRenderIcon( null );
renderTorchAtAngle( renderer, fdx, fdy, fdz );
super.postRenderInWorld( renderer );
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
int s = 1;
for (ForgeDirection side : sides)
{
renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2
+ (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2),
8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
super.renderInWorld( blk, world, x, y, z, renderer );
}
s = 3;
for (ForgeDirection side : sides)
{
renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1
+ (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1),
8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
super.renderInWorld( blk, world, x, y, z, renderer );
}
r = CableBusTextures.PartMonitorSidesStatusLights.getIcon();
// ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(),
// ExtraTextures.BlockChargerInside.getIcon(), r, r );
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
if ( hasChan )
{
int l = 14;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( AEColor.Transparent.blackVariant );
}
else if ( hasPower )
{
int l = 9;
Tessellator.instance.setBrightness( l << 20 | l << 4 );
Tessellator.instance.setColorOpaque_I( AEColor.Transparent.whiteVariant );
}
else
{
Tessellator.instance.setBrightness( 0 );
Tessellator.instance.setColorOpaque_I( 0x000000 );
}
if ( ForgeDirection.UP != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.UP );
if ( ForgeDirection.DOWN != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.DOWN );
if ( ForgeDirection.EAST != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.EAST );
if ( ForgeDirection.WEST != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.WEST );
if ( ForgeDirection.SOUTH != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.SOUTH );
if ( ForgeDirection.NORTH != fdz.getOpposite() )
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.NORTH );
ri.setTemporaryRenderIcon( null );
renderer.renderAllFaces = false;
}
return true;
}