@ForgeSubscribe public void onItemBroken(PlayerDestroyItemEvent event) { ItemStack ist = event.original; EntityPlayer ep = event.entityPlayer; InventoryPickaxe inp = new InventoryPickaxe(ist, false); inp.dropInto(ep.inventory); if (ist.getItem().itemID == FPR2.Laevatain.itemID) { int invIndex = ep.inventory.currentItem; ep.inventory.setInventorySlotContents(invIndex, FPR2.CoreLaevatainBroken.copy()); } }
public void damageItem(ItemStack ist, EntityLivingBase user) { InventoryPickaxe inp = new InventoryPickaxe(ist, false); if (inp.canDecreaseDamage(ist)) return; ist.damageItem(1, user); }
private boolean isInvHasEffect(ItemStack ist) { InventoryPickaxe inp = new InventoryPickaxe(ist, false); return inp.hasEffect(); }