Fixed turbine output falling when supplying more than opt flow

This commit is contained in:
Blood-Asp 2016-03-17 00:41:15 +01:00
parent 7ac0849c1a
commit be8d29da74
4 changed files with 4 additions and 0 deletions

View file

@ -108,6 +108,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT
if (totalFlow != actualOptimalFlow) { if (totalFlow != actualOptimalFlow) {
float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow));
if(totalFlow>aOptFlow){efficiency = 1.0f;}
if (efficiency < 0) if (efficiency < 0)
efficiency = 0; // Can happen with really ludicrously poor inefficiency. efficiency = 0; // Can happen with really ludicrously poor inefficiency.
tEU *= efficiency; tEU *= efficiency;

View file

@ -95,6 +95,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
addOutput(GT_ModHandler.getSteam(totalFlow)); addOutput(GT_ModHandler.getSteam(totalFlow));
if (totalFlow > 0 && totalFlow != aOptFlow) { if (totalFlow > 0 && totalFlow != aOptFlow) {
float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow));
if(totalFlow>aOptFlow){efficiency = 1.0f;}
tEU *= efficiency; tEU *= efficiency;
tEU = Math.max(1, tEU * aBaseEff / 10000); tEU = Math.max(1, tEU * aBaseEff / 10000);
} else { } else {

View file

@ -109,6 +109,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
if (totalFlow != actualOptimalFlow) { if (totalFlow != actualOptimalFlow) {
float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow));
if(totalFlow>aOptFlow){efficiency = 1.0f;}
if (efficiency < 0) if (efficiency < 0)
efficiency = 0; // Can happen with really ludicrously poor inefficiency. efficiency = 0; // Can happen with really ludicrously poor inefficiency.
tEU *= efficiency; tEU *= efficiency;

View file

@ -106,6 +106,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
addOutput(GT_ModHandler.getDistilledWater(waterToOutput)); addOutput(GT_ModHandler.getDistilledWater(waterToOutput));
if (totalFlow > 0 && totalFlow != aOptFlow) { if (totalFlow > 0 && totalFlow != aOptFlow) {
float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow));
if(totalFlow>aOptFlow){efficiency = 1.0f;}
tEU *= efficiency; tEU *= efficiency;
tEU = Math.max(1, tEU * aBaseEff / 20000); tEU = Math.max(1, tEU * aBaseEff / 20000);
} else { } else {