use of forestry.core.render.EnumTankLevel 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.render.EnumTankLevel in project ForestryMC by ForestryMC.
the class GuiEngineElectric method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
TileEngineElectric engine = tile;
int storageHeight = engine.getStorageScaled(46);
int storageMaxHeight = engine.getStorageScaled(100);
EnumTankLevel rated = EnumTankLevel.rateTankLevel(storageMaxHeight);
drawHealthMeter(guiLeft + 74, guiTop + 25, storageHeight, rated);
}
Aggregations