mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-27 01:08:34 +01:00
made the magnet ring not use energy when not picking something up
This commit is contained in:
parent
723da24eb7
commit
770e02c65a
1 changed files with 5 additions and 1 deletions
|
@ -43,10 +43,14 @@ public class ItemMagnetRing extends ItemEnergy{
|
||||||
int energyForItem = 350*StackUtil.getStackSize(item.getEntityItem());
|
int energyForItem = 350*StackUtil.getStackSize(item.getEntityItem());
|
||||||
|
|
||||||
if(this.getEnergyStored(stack) >= energyForItem){
|
if(this.getEnergyStored(stack) >= energyForItem){
|
||||||
|
ItemStack oldItem = StackUtil.validateCopy(item.getEntityItem());
|
||||||
|
|
||||||
item.onCollideWithPlayer(player);
|
item.onCollideWithPlayer(player);
|
||||||
|
|
||||||
if(!player.capabilities.isCreativeMode){
|
if(!player.capabilities.isCreativeMode){
|
||||||
this.extractEnergy(stack, energyForItem, false);
|
if(item.isDead || !ItemStack.areItemStacksEqual(item.getEntityItem(), oldItem)){
|
||||||
|
this.extractEnergy(stack, energyForItem, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue