Fix the magnet ring using energy when not picking anything up

Closes #589
This commit is contained in:
Ellpeck 2017-01-30 18:44:29 +01:00
parent 2d4c7db2aa
commit 1b27148792

View file

@ -52,10 +52,14 @@ public class ItemMagnetRing extends ItemEnergy{
int energyForItem = 50*StackUtil.getStackSize(item.getEntityItem());
if(this.getEnergyStored(stack) >= energyForItem){
ItemStack oldItem = StackUtil.validateCopy(item.getEntityItem());
item.onCollideWithPlayer(player);
if(!player.capabilities.isCreativeMode){
this.extractEnergyInternal(stack, energyForItem, false);
if(item.isDead || !ItemStack.areItemStacksEqual(item.getEntityItem(), oldItem)){
this.extractEnergyInternal(stack, energyForItem, false);
}
}
}
}