diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineTurbineGas.java b/src/main/java/com/hbm/inventory/gui/GUIMachineTurbineGas.java index eee3c7fad..241b1e6eb 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineTurbineGas.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineTurbineGas.java @@ -109,21 +109,24 @@ public class GUIMachineTurbineGas extends GuiInfoContainer { } @Override - public void drawScreen(int mouseX, int mouseY, float f) { +public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 108, 142, 16, turbinegas.power, turbinegas.getMaxPower()); - if(turbinegas.powerSliderPos == 0) - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 36, guiTop + 36, 16, 66, mouseX, mouseY, new String[] {"Turbine idle"}); - else - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 36, guiTop + 36, 16, 66, mouseX, mouseY, new String[] {(turbinegas.powerSliderPos) * 100 / 60 + "% power"}); + if(turbinegas.state == 1) { + double consumption = turbinegas.fuelMaxCons.containsKey(turbinegas.tanks[0].getTankType()) ? turbinegas.fuelMaxCons.get(turbinegas.tanks[0].getTankType()) : 5D; + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 36, guiTop + 36, 16, 66, mouseX, mouseY, new String[] {"Fuel consumption: " + 20 * (consumption * 0.05D + consumption * turbinegas.throttle / 100) + " mb/s"}); + } + else { + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 36, guiTop + 36, 16, 66, mouseX, mouseY, new String[] {"Generator offline"}); + } if(turbinegas.temp >= 20) - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 23, 8, 72, mouseX, mouseY, new String[] {"Temperature: " + (turbinegas.temp) + "°C"}); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 23, 8, 72, mouseX, mouseY, new String[] {"Temperature: " + (turbinegas.temp) + "°C"}); else - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 23, 8, 72, mouseX, mouseY, new String[] {"Temperature: 20°C"}); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 23, 8, 72, mouseX, mouseY, new String[] {"Temperature: 20°C"}); turbinegas.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 16, 16, 48); turbinegas.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70, 16, 32); @@ -146,6 +149,7 @@ public class GUIMachineTurbineGas extends GuiInfoContainer { if(turbinegas.tanks[0].getFill() < 5000 || turbinegas.tanks[1].getFill() < 1000) this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 34 + 32, 16, 16, guiLeft - 8, guiTop + 44 + 16, warning); } + @Override protected void drawGuiContainerBackgroundLayer(float iinterpolation, int x, int y) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java index 0e5d6b9a1..b0705734c 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java @@ -105,21 +105,19 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement tanks[0].setTankType(fluid); } } -<<<<<<< HEAD - if(autoMode) { //power production depending on power requirement + if(autoMode) { //power production depending on power requirement and fuel level - //scales the slider proportionally to the power gauge - int powerSliderTarget = 60 - (int) (60 * power / maxPower); + int powerSliderTarget; + + //when low on fuel, decrease consumption linearly + if(tanks[0].getFill() * 10 > tanks[0].getMaxFill()) { + powerSliderTarget = 60 - (int) (60 * power / maxPower); //scales the slider proportionally to the power gauge + } + else { + powerSliderTarget = (int) ( tanks[0].getFill() * 0.0001 * (60 - (int) (60 * power / maxPower)) ); + } -======= - - if(autoMode) { //power production depending on power requirement - - //scales the slider proportionally to the power gauge - int powerSliderTarget = 60 - (int) (60 * power / maxPower); - ->>>>>>> origin/master if(powerSliderTarget > powerSliderPos) { //makes the auto slider slide instead of snapping into position powerSliderPos++; } diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index cb32c226e..ed0747f04 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1033,7 +1033,7 @@ desc.gui.rtg.pellets=Accepted Pellets: desc.gui.rtg.pelletHeat=%s (%s heat) desc.gui.rtg.pelletPower=%s (%s HE/tick) desc.gui.template=§9Templates§r$Templates can be made by$using the Machine Template Folder. -desc.gui.turbinegas.automode=§2Automatic Turbine Throttling Mode§r$By clicking the "AUTO" button, the turbine$will automatically adjust the power production$based on the power required from the network +desc.gui.turbinegas.automode=§2Automatic turbine throttling mode§r$By clicking the "AUTO" button, the turbine$will automatically adjust the throttle position$based on the power required from the network$and the fuel level in the internal tank desc.gui.turbinegas.fuels=§6Accepted fuels:§r desc.gui.turbinegas.warning=§cFuel or lubricant level low!§r desc.gui.zirnox.coolant=§3Coolant§r$CO2 transfers heat from the core to the water.$This will boil it into super dense steam.$The efficiency of cooling and steam production$is based on pressure. diff --git a/src/main/resources/assets/hbm/textures/models/machines/turbinegas.png b/src/main/resources/assets/hbm/textures/models/machines/turbinegas.png index 290e3810b..4e33cca35 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/turbinegas.png and b/src/main/resources/assets/hbm/textures/models/machines/turbinegas.png differ