fix wooden kinesis pipes not taking energy from certain RF generators unless they already had energy in them

This commit is contained in:
asiekierka 2014-10-15 18:13:21 +02:00
parent 0db1a4cbe3
commit 249caf7e21

View file

@ -103,7 +103,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPowerRec
return; return;
} }
if (battery.getEnergyStored() == 0 || sources == 0) { if (sources == 0) {
return; return;
} }
@ -141,15 +141,17 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPowerRec
} }
} }
for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { if (battery.getEnergyStored() > 0) {
if (!powerSources[o.ordinal()]) { for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
continue; if (!powerSources[o.ordinal()]) {
} continue;
}
int energyUsable = Math.min(battery.getEnergyStored(), energyToRemove);
int energyUsable = Math.min(battery.getEnergyStored(), energyToRemove);
if (energyUsable > 0) {
battery.setEnergy(battery.getEnergyStored() - transport.receiveEnergy(o, energyUsable)); if (energyUsable > 0) {
battery.setEnergy(battery.getEnergyStored() - transport.receiveEnergy(o, energyUsable));
}
} }
} }