Merge pull request #134 from pyure/patch-4

Large Heat Exchanger water/steam ratio
This commit is contained in:
Blood-Asp 2015-08-12 15:52:21 +02:00
commit b0a60598aa

View file

@ -121,18 +121,28 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
return usage; return usage;
} }
public boolean onRunningTick(ItemStack aStack) public boolean onRunningTick(ItemStack aStack) {
{
if (this.mEUt > 0) if (this.mEUt > 0) {
{ int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
if (tGeneratedEU > 0) { if (tGeneratedEU > 0) {
if (depleteInput(GT_ModHandler.getDistilledWater(useWater(((float)(superheated ? tGeneratedEU/2 :tGeneratedEU) + 160f) / 160f)))) { if (superheated)
if(superheated){addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU/2)); tGeneratedEU /= 2; // We produce half as much superheated steam if necessary
int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume
tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption
FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed);
if (depleteInput(distilledStack)) // Consume the distilled water
{
if (superheated) {
addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
} else { } else {
addOutput(GT_ModHandler.getSteam(tGeneratedEU));} addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
}
} else { } else {
explodeMultiblock(); explodeMultiblock(); // Generate crater
} }
} }
return true; return true;