From 249caf7e2158fe87d6d4e1c97a0564a1e6fb97d9 Mon Sep 17 00:00:00 2001 From: asiekierka Date: Wed, 15 Oct 2014 18:13:21 +0200 Subject: [PATCH] fix wooden kinesis pipes not taking energy from certain RF generators unless they already had energy in them --- .../transport/pipes/PipePowerWood.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/common/buildcraft/transport/pipes/PipePowerWood.java b/common/buildcraft/transport/pipes/PipePowerWood.java index 2f0b16d6..0eb76917 100644 --- a/common/buildcraft/transport/pipes/PipePowerWood.java +++ b/common/buildcraft/transport/pipes/PipePowerWood.java @@ -103,7 +103,7 @@ public class PipePowerWood extends Pipe implements IPowerRec return; } - if (battery.getEnergyStored() == 0 || sources == 0) { + if (sources == 0) { return; } @@ -141,15 +141,17 @@ public class PipePowerWood extends Pipe implements IPowerRec } } - for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { - if (!powerSources[o.ordinal()]) { - continue; - } - - int energyUsable = Math.min(battery.getEnergyStored(), energyToRemove); - - if (energyUsable > 0) { - battery.setEnergy(battery.getEnergyStored() - transport.receiveEnergy(o, energyUsable)); + if (battery.getEnergyStored() > 0) { + for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { + if (!powerSources[o.ordinal()]) { + continue; + } + + int energyUsable = Math.min(battery.getEnergyStored(), energyToRemove); + + if (energyUsable > 0) { + battery.setEnergy(battery.getEnergyStored() - transport.receiveEnergy(o, energyUsable)); + } } }