diff --git a/src/main/java/mekanism/api/MekanismConfig.java b/src/main/java/mekanism/api/MekanismConfig.java index 29e497bd3..fe85beeb3 100644 --- a/src/main/java/mekanism/api/MekanismConfig.java +++ b/src/main/java/mekanism/api/MekanismConfig.java @@ -62,6 +62,7 @@ public class MekanismConfig public static double evaporationSolarMultiplier = 0.2; public static double evaporationMaxTemp = 3000; public static double energyPerHeat = 1000; + public static double maxEnergyPerSteam = 100; public static double superheatingHeatTransfer = 10000; } @@ -139,7 +140,6 @@ public class MekanismConfig public static int windGenerationMaxY; public static int turbineBladesPerCoil; - public static double turbineBaseEnergyPerSteam; public static double turbineVentGasFlow; public static double turbineDisperserGasFlow; } diff --git a/src/main/java/mekanism/client/gui/GuiThermoelectricBoiler.java b/src/main/java/mekanism/client/gui/GuiThermoelectricBoiler.java index 7789329ec..d8ae6623f 100644 --- a/src/main/java/mekanism/client/gui/GuiThermoelectricBoiler.java +++ b/src/main/java/mekanism/client/gui/GuiThermoelectricBoiler.java @@ -13,6 +13,7 @@ import mekanism.client.gui.element.GuiHeatInfo; import mekanism.client.gui.element.GuiRateBar; import mekanism.client.gui.element.GuiRateBar.IRateInfoHandler; import mekanism.client.render.MekanismRenderer; +import mekanism.common.content.boiler.SynchronizedBoilerData; import mekanism.common.inventory.container.ContainerFilter; import mekanism.common.tile.TileEntityBoilerCasing; import mekanism.common.util.LangUtils; @@ -47,9 +48,7 @@ public class GuiThermoelectricBoiler extends GuiMekanism @Override public double getLevel() { - double max = Math.floor(tileEntity.structure.clientHeatAvailable / tileEntity.structure.enthalpyOfVaporization); - - return (double)tileEntity.structure.lastBoilRate/max; + return (double)tileEntity.structure.lastBoilRate/(double)tileEntity.structure.lastMaxBoil; } }, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png"), 24, 13)); guiElements.add(new GuiRateBar(this, new IRateInfoHandler() @@ -57,17 +56,14 @@ public class GuiThermoelectricBoiler extends GuiMekanism @Override public String getTooltip() { - int max = (int)Math.floor(tileEntity.structure.clientHeatAvailable / tileEntity.structure.enthalpyOfVaporization); - - return LangUtils.localize("gui.maxBoil") + ": " + max + " mB/t"; + return LangUtils.localize("gui.maxBoil") + ": " + tileEntity.structure.lastMaxBoil + " mB/t"; } @Override public double getLevel() { - double max = Math.floor(tileEntity.structure.clientHeatAvailable / tileEntity.structure.enthalpyOfVaporization); - double cap = (tileEntity.structure.superheatingElements*general.superheatingHeatTransfer) / tileEntity.structure.enthalpyOfVaporization; - return max/cap; + double cap = (tileEntity.structure.superheatingElements*general.superheatingHeatTransfer) / SynchronizedBoilerData.getHeatEnthalpy(); + return (double)tileEntity.structure.lastMaxBoil/cap; } }, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png"), 144, 13)); guiElements.add(new GuiHeatInfo(new IInfoHandler() { @@ -89,11 +85,9 @@ public class GuiThermoelectricBoiler extends GuiMekanism fontRendererObj.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040); fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 5, 0x404040); - double max = (int)Math.floor(tileEntity.structure.clientHeatAvailable / tileEntity.structure.enthalpyOfVaporization); - renderScaledText(LangUtils.localize("gui.temp") + ": " + MekanismUtils.getTemperatureDisplay(tileEntity.structure.temperature, TemperatureUnit.AMBIENT), 43, 30, 0x00CD00, 90); renderScaledText(LangUtils.localize("gui.boilRate") + ": " + tileEntity.structure.lastBoilRate + " mB/t", 43, 39, 0x00CD00, 90); - renderScaledText(LangUtils.localize("gui.maxBoil") + ": " + max + " mB/t", 43, 48, 0x00CD00, 90); + renderScaledText(LangUtils.localize("gui.maxBoil") + ": " + tileEntity.structure.lastMaxBoil + " mB/t", 43, 48, 0x00CD00, 90); if(xAxis >= 7 && xAxis <= 23 && yAxis >= 14 && yAxis <= 72) { diff --git a/src/main/java/mekanism/common/CommonProxy.java b/src/main/java/mekanism/common/CommonProxy.java index 81966ca01..c1cd3a73b 100644 --- a/src/main/java/mekanism/common/CommonProxy.java +++ b/src/main/java/mekanism/common/CommonProxy.java @@ -282,6 +282,8 @@ public class CommonProxy implements IGuiProvider general.evaporationSolarMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationSolarMultiplier", 0.2D).getDouble(); general.evaporationMaxTemp = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationMaxTemp", 3000D).getDouble(); general.energyPerHeat = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerHeat", 1000D).getDouble(); + general.maxEnergyPerSteam = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxEnergyPerSteam", 100D).getDouble(); + general.superheatingHeatTransfer = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SuperheatingHeatTransfer", 10000D).getDouble(); general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean(); general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean(); diff --git a/src/main/java/mekanism/common/content/boiler/SynchronizedBoilerData.java b/src/main/java/mekanism/common/content/boiler/SynchronizedBoilerData.java index ed97dbd9e..d90ed2aec 100644 --- a/src/main/java/mekanism/common/content/boiler/SynchronizedBoilerData.java +++ b/src/main/java/mekanism/common/content/boiler/SynchronizedBoilerData.java @@ -28,16 +28,13 @@ public class SynchronizedBoilerData extends SynchronizedData valves = new HashSet(); + /** + * @return how much heat energy is needed to convert one unit of water into steam + */ + public static double getHeatEnthalpy() + { + return general.maxEnergyPerSteam/general.energyPerHeat; + } + public double getHeatAvailable() { double heatAvailable = (temperature-BASE_BOIL_TEMP)*locations.size(); diff --git a/src/main/java/mekanism/common/network/PacketConfigSync.java b/src/main/java/mekanism/common/network/PacketConfigSync.java index 9d0d008bc..a24cfc57d 100644 --- a/src/main/java/mekanism/common/network/PacketConfigSync.java +++ b/src/main/java/mekanism/common/network/PacketConfigSync.java @@ -68,6 +68,9 @@ public class PacketConfigSync implements IMessageHandler getInfo() { - double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); + double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); return ListUtils.asList( LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), @@ -77,7 +79,7 @@ public class GuiIndustrialTurbine extends GuiMekanism fontRendererObj.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040); fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 5, 0x404040); - double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); + double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow); rate = Math.min(rate, tileEntity.structure.vents*generators.turbineVentGasFlow); diff --git a/src/main/java/mekanism/generators/client/gui/GuiTurbineStats.java b/src/main/java/mekanism/generators/client/gui/GuiTurbineStats.java index 2bdac5b4d..a389fde46 100644 --- a/src/main/java/mekanism/generators/client/gui/GuiTurbineStats.java +++ b/src/main/java/mekanism/generators/client/gui/GuiTurbineStats.java @@ -3,6 +3,7 @@ package mekanism.generators.client.gui; import java.util.List; import mekanism.api.EnumColor; +import mekanism.api.MekanismConfig.general; import mekanism.api.MekanismConfig.generators; import mekanism.api.util.ListUtils; import mekanism.client.gui.GuiMekanism; @@ -14,6 +15,7 @@ import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; import mekanism.generators.client.gui.element.GuiTurbineTab; import mekanism.generators.client.gui.element.GuiTurbineTab.TurbineTab; +import mekanism.generators.common.content.turbine.TurbineUpdateProtocol; import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing; import net.minecraft.entity.player.InventoryPlayer; @@ -37,7 +39,7 @@ public class GuiTurbineStats extends GuiMekanism @Override public List getInfo() { - double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); + double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); return ListUtils.asList( LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), @@ -75,7 +77,7 @@ public class GuiTurbineStats extends GuiMekanism fontRendererObj.drawString(LangUtils.localize("gui.blades") + ": " + tileEntity.structure.blades + (bladesLimiting ? limiting : ""), 14, 81, 0x404040); fontRendererObj.drawString(LangUtils.localize("gui.coils") + ": " + tileEntity.structure.coils + (coilsLimiting ? limiting : ""), 14, 90, 0x404040); - double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); + double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil); double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow); rate = Math.min(rate, tileEntity.structure.vents*generators.turbineVentGasFlow); diff --git a/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java b/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java index 0e7c95588..ef41bbec4 100644 --- a/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java +++ b/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java @@ -100,7 +100,6 @@ public class GeneratorsCommonProxy implements IGuiProvider loadWindConfiguration(); generators.turbineBladesPerCoil = Mekanism.configuration.get("generation", "TurbineBladesPerCoil", 4).getInt(); - generators.turbineBaseEnergyPerSteam = Mekanism.configuration.get("generation", "TurbineBaseEnergyPerSteam", 10D).getDouble(); generators.turbineVentGasFlow = Mekanism.configuration.get("generation", "TurbineVentGasFlow", 16000D).getDouble(); generators.turbineDisperserGasFlow = Mekanism.configuration.get("generation", "TurbineDisperserGasFlow", 640D).getDouble(); diff --git a/src/main/java/mekanism/generators/common/MekanismGenerators.java b/src/main/java/mekanism/generators/common/MekanismGenerators.java index 9b00244c8..a4208a7de 100644 --- a/src/main/java/mekanism/generators/common/MekanismGenerators.java +++ b/src/main/java/mekanism/generators/common/MekanismGenerators.java @@ -208,7 +208,6 @@ public class MekanismGenerators implements IModule dataStream.writeInt(generators.windGenerationMaxY); dataStream.writeInt(generators.turbineBladesPerCoil); - dataStream.writeDouble(generators.turbineBaseEnergyPerSteam); dataStream.writeDouble(generators.turbineVentGasFlow); dataStream.writeDouble(generators.turbineDisperserGasFlow); } @@ -230,7 +229,6 @@ public class MekanismGenerators implements IModule generators.windGenerationMaxY = dataStream.readInt(); generators.turbineBladesPerCoil = dataStream.readInt(); - generators.turbineBaseEnergyPerSteam = dataStream.readDouble(); generators.turbineVentGasFlow = dataStream.readDouble(); generators.turbineDisperserGasFlow = dataStream.readDouble(); } diff --git a/src/main/java/mekanism/generators/common/content/turbine/TurbineUpdateProtocol.java b/src/main/java/mekanism/generators/common/content/turbine/TurbineUpdateProtocol.java index 9a65de0dd..21cdc3b05 100644 --- a/src/main/java/mekanism/generators/common/content/turbine/TurbineUpdateProtocol.java +++ b/src/main/java/mekanism/generators/common/content/turbine/TurbineUpdateProtocol.java @@ -25,6 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class TurbineUpdateProtocol extends UpdateProtocol { public static final int FLUID_PER_TANK = TankUpdateProtocol.FLUID_PER_TANK; + public static final int MAX_BLADES = 28; public TurbineUpdateProtocol(TileEntityTurbineCasing tileEntity) { diff --git a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineCasing.java b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineCasing.java index b6dec8d98..39879c3e8 100644 --- a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineCasing.java +++ b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineCasing.java @@ -5,6 +5,7 @@ import io.netty.buffer.ByteBuf; import java.util.ArrayList; import mekanism.api.Coord4D; +import mekanism.api.MekanismConfig.general; import mekanism.api.MekanismConfig.generators; import mekanism.api.Range4D; import mekanism.api.energy.IStrictEnergyStorage; @@ -63,7 +64,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock 0 && getEnergy() < structure.getEnergyCapacity()) { - double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(structure.blades, structure.coils*generators.turbineBladesPerCoil); + double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(structure.blades, structure.coils*generators.turbineBladesPerCoil); double rate = structure.lowerVolume*(structure.getDispersers()*generators.turbineDisperserGasFlow); rate = Math.min(rate, structure.vents*generators.turbineVentGasFlow);