From f2f182838666b3a26df90de35f15cc46b42e6250 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Thu, 29 Aug 2013 07:27:56 -0700 Subject: [PATCH] Limit Coolant per tick rather Cooling per tick Makes better Coolants more desirable because they can cool faster. --- common/buildcraft/energy/TileEngineIron.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/common/buildcraft/energy/TileEngineIron.java b/common/buildcraft/energy/TileEngineIron.java index 392793fd..c87229fc 100644 --- a/common/buildcraft/energy/TileEngineIron.java +++ b/common/buildcraft/energy/TileEngineIron.java @@ -43,7 +43,7 @@ public class TileEngineIron extends TileEngine implements IFluidHandler { public static int MAX_LIQUID = FluidContainerRegistry.BUCKET_VOLUME * 10; public static float HEAT_PER_MJ = 0.0023F; public static float COOLDOWN_RATE = 0.05F; - public static float MAX_COOLING = 0.1F; + public static int MAX_COOLANT_PER_TICK = 40; int burnTime = 0; private Tank tankFuel; private Tank tankCoolant; @@ -217,19 +217,22 @@ public class TileEngineIron extends TileEngine implements IFluidHandler { private void coolEngine(float idealHeat) { float extraHeat = heat - idealHeat; - extraHeat = Math.min(MAX_COOLING, extraHeat); FluidStack coolant = this.tankCoolant.getFluid(); + if (coolant == null) + return; + + int coolantAmount = Math.min(MAX_COOLANT_PER_TICK, coolant.amount); Coolant currentCoolant = IronEngineCoolant.getCoolant(coolant); if (currentCoolant != null) { float cooling = currentCoolant.getDegreesCoolingPerMB(heat); cooling /= getBiomeTempScalar(); - if (coolant.amount * cooling > extraHeat) { - coolant.amount -= Math.round(extraHeat / cooling); + if (coolantAmount * cooling > extraHeat) { + tankCoolant.drain(Math.round(extraHeat / cooling), true); heat -= extraHeat; } else { - heat -= coolant.amount * cooling; - tankCoolant.setFluid(null); + tankCoolant.drain(coolantAmount, true); + heat -= coolantAmount * cooling; } } }