From 3544addf20e32c6c9c37aca5b83f345094640f55 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 22 Dec 2014 20:10:01 +0000 Subject: [PATCH] Make heat generator not lose energy when below ambient temperature, and use the Carnot Engine equations for efficiency. --- .../common/tile/TileEntityHeatGenerator.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/mekanism/generators/common/tile/TileEntityHeatGenerator.java b/src/main/java/mekanism/generators/common/tile/TileEntityHeatGenerator.java index 6de02503b..30c3307b9 100644 --- a/src/main/java/mekanism/generators/common/tile/TileEntityHeatGenerator.java +++ b/src/main/java/mekanism/generators/common/tile/TileEntityHeatGenerator.java @@ -405,9 +405,14 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu @Override public double[] simulateHeat() { - double workDone = getTemp()*thermalEfficiency; - transferHeatTo(-workDone); - setEnergy(getEnergy() + workDone); + if(getTemp() > 0) + { + double carnotEfficiency = getTemp() / (getTemp() + IHeatTransfer.AMBIENT_TEMP); + double heatLost = thermalEfficiency * getTemp(); + double workDone = heatLost * carnotEfficiency; + transferHeatTo(-heatLost); + setEnergy(getEnergy() + workDone); + } return HeatUtils.simulate(this, Coord4D.get(this), worldObj); }