Fix an energy dupe bug with batteries

This commit is contained in:
Ellpeck 2016-11-23 18:25:08 +01:00
parent 3ed5e9cc8a
commit 9b2628e9aa
2 changed files with 3 additions and 3 deletions

View file

@ -59,12 +59,12 @@ public class ItemBattery extends ItemEnergy{
Item item = slot.getItem(); Item item = slot.getItem();
if(item instanceof IEnergyContainerItem){ 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)){ else if(ActuallyAdditions.teslaLoaded && slot.hasCapability(TeslaUtil.teslaConsumer, null)){
ITeslaConsumer cap = slot.getCapability(TeslaUtil.teslaConsumer, null); ITeslaConsumer cap = slot.getCapability(TeslaUtil.teslaConsumer, null);
if(cap != null){ if(cap != null){
received = (int)cap.givePower(this.getEnergyStored(stack), false); received = (int)cap.givePower(this.extractEnergy(stack, Integer.MAX_VALUE, true), false);
} }
} }

View file

@ -147,7 +147,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
@Override @Override
public void extractEnergy(int amount){ public void extractEnergy(int amount){
this.storage.extractEnergyInternal(amount, false); this.storage.extractEnergy(amount, false);
} }
@Override @Override