Merge pull request #3601 from HenryLoenwind/genStall

Backport: Prevent generators from stalling if they are configured to produce more RF/t than normal
This commit is contained in:
CrazyPants authored and GitHub committed 2016-08-11 18:15:23 +08:00
commit 11e874b89e
2 files changed
+2 -2

No files matched your search

@@ -214,7 +214,7 @@ public class TileCombustionGenerator extends AbstractGeneratorEntity implements
//flickering on and off constantly when powering a machine that draws less than this produces
if(inPause) {
int powerPerCycle = getPowerPerCycle();
if(getEnergyStored() >= (getMaxEnergyStored() - (powerPerCycle * 200))) {
if (getEnergyStored() >= (getMaxEnergyStored() - (powerPerCycle * 200)) && getEnergyStored() > (getMaxEnergyStored() / 8)) {
return false;
}
}
@@ -146,7 +146,7 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
//once full, don't start again until we have drained 10 seconds worth of power to prevent
//flickering on and off constantly when powering a machine that draws less than this produces
if(inPause && getEnergyStored() >= (getMaxEnergyStored() - (outputPerTick * 200))) {
if (inPause && getEnergyStored() >= (getMaxEnergyStored() - (outputPerTick * 200)) && getEnergyStored() > (getMaxEnergyStored() / 8)) {
return false;
}
inPause = false;