Merge pull request #134 from pyure/patch-4
Large Heat Exchanger water/steam ratio
This commit is contained in:
commit
b0a60598aa
1 changed files with 20 additions and 10 deletions
|
@ -121,18 +121,28 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
|
|||
return usage;
|
||||
}
|
||||
|
||||
public boolean onRunningTick(ItemStack aStack)
|
||||
{
|
||||
if (this.mEUt > 0)
|
||||
{
|
||||
int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
|
||||
public boolean onRunningTick(ItemStack aStack) {
|
||||
|
||||
if (this.mEUt > 0) {
|
||||
int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
|
||||
|
||||
if (tGeneratedEU > 0) {
|
||||
if (depleteInput(GT_ModHandler.getDistilledWater(useWater(((float)(superheated ? tGeneratedEU/2 :tGeneratedEU) + 160f) / 160f)))) {
|
||||
if(superheated){addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU/2));
|
||||
}else{
|
||||
addOutput(GT_ModHandler.getSteam(tGeneratedEU));}
|
||||
if (superheated)
|
||||
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 {
|
||||
explodeMultiblock();
|
||||
addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
|
||||
}
|
||||
} else {
|
||||
explodeMultiblock(); // Generate crater
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue