From 9b2628e9aab892f5c6852dc1cd0d6ea48a6777db Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 23 Nov 2016 18:25:08 +0100 Subject: [PATCH] Fix an energy dupe bug with batteries --- .../de/ellpeck/actuallyadditions/mod/items/ItemBattery.java | 4 ++-- .../mod/tile/TileEntityAtomicReconstructor.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index 699e06772..37a5582ae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -59,12 +59,12 @@ public class ItemBattery extends ItemEnergy{ Item item = slot.getItem(); if(item instanceof IEnergyContainerItem){ - received = ((IEnergyContainerItem)item).receiveEnergy(slot, this.getEnergyStored(stack), false); + received = ((IEnergyContainerItem)item).receiveEnergy(slot, this.extractEnergy(stack, Integer.MAX_VALUE, true), false); } else if(ActuallyAdditions.teslaLoaded && slot.hasCapability(TeslaUtil.teslaConsumer, null)){ ITeslaConsumer cap = slot.getCapability(TeslaUtil.teslaConsumer, null); if(cap != null){ - received = (int)cap.givePower(this.getEnergyStored(stack), false); + received = (int)cap.givePower(this.extractEnergy(stack, Integer.MAX_VALUE, true), false); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 7c89bc25b..5a438a958 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -147,7 +147,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple @Override public void extractEnergy(int amount){ - this.storage.extractEnergyInternal(amount, false); + this.storage.extractEnergy(amount, false); } @Override