use of forestry.core.tiles.IRenderableTile in project ForestryMC by ForestryMC.
the class TankManager method updateTankLevels.
private void updateTankLevels(StandardTank tank, boolean sendUpdate) {
if (!(tile instanceof IRenderableTile)) {
return;
}
int tankIndex = tank.getTankIndex();
EnumTankLevel tankLevel = EnumTankLevel.rateTankLevel(tank);
if (tankLevel != tankLevels.get(tankIndex)) {
tankLevels.set(tankIndex, tankLevel);
if (sendUpdate) {
PacketTankLevelUpdate tankLevelUpdate = new PacketTankLevelUpdate(tile, tankIndex, tank.getFluid());
NetworkUtil.sendNetworkPacket(tankLevelUpdate, tile.getCoordinates(), tile.getWorldObj());
}
}
}
use of forestry.core.tiles.IRenderableTile in project ForestryMC by ForestryMC.
the class RenderMachine method render.
/**
* @param tile If it null its render the item else it render the tile entity.
*/
@Override
public void render(TileBase tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (tile != null) {
IRenderableTile generator = (IRenderableTile) tile;
World worldObj = tile.getWorldObj();
if (worldObj.isBlockLoaded(tile.getPos())) {
IBlockState blockState = worldObj.getBlockState(tile.getPos());
if (blockState.getBlock() instanceof BlockBase) {
EnumFacing facing = blockState.getValue(BlockBase.FACING);
render(generator.getResourceTankInfo(), generator.getProductTankInfo(), facing, x, y, z, destroyStage);
return;
}
}
}
render(TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, EnumFacing.SOUTH, x, y, z, -1);
}
Aggregations