From 770e02c65a65d865575f381f90161ee9d767c5d2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 10 Mar 2017 23:07:59 +0100 Subject: [PATCH] made the magnet ring not use energy when not picking something up --- .../ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java index ea9cb3f76..3cb84fb9a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java @@ -43,10 +43,14 @@ public class ItemMagnetRing extends ItemEnergy{ int energyForItem = 350*StackUtil.getStackSize(item.getEntityItem()); if(this.getEnergyStored(stack) >= energyForItem){ + ItemStack oldItem = StackUtil.validateCopy(item.getEntityItem()); + item.onCollideWithPlayer(player); if(!player.capabilities.isCreativeMode){ - this.extractEnergy(stack, energyForItem, false); + if(item.isDead || !ItemStack.areItemStacksEqual(item.getEntityItem(), oldItem)){ + this.extractEnergy(stack, energyForItem, false); + } } } }