diff --git a/common/buildcraft/core/lib/block/TileBuildCraft.java b/common/buildcraft/core/lib/block/TileBuildCraft.java index 2e608fa6..33d8c01b 100644 --- a/common/buildcraft/core/lib/block/TileBuildCraft.java +++ b/common/buildcraft/core/lib/block/TileBuildCraft.java @@ -186,7 +186,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if (battery != null && this.canConnectEnergy(from)) { - int received = battery.receiveEnergy(maxReceive - receivedTick, simulate); + int received = battery.receiveEnergy(Math.min(maxReceive, battery.getMaxEnergyReceive() - receivedTick), simulate); if (!simulate) { receivedTick += received; worldTimeEnergyReceive = worldObj.getTotalWorldTime(); @@ -203,7 +203,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { if (battery != null && this.canConnectEnergy(from)) { - int extracted = battery.extractEnergy(maxExtract - extractedTick, simulate); + int extracted = battery.extractEnergy(Math.min(maxExtract, battery.getMaxEnergyExtract() - extractedTick), simulate); if (!simulate) { extractedTick += extracted; }