コード例 #1
0
  @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());
    }
  }
コード例 #2
0
  public void damageItem(ItemStack ist, EntityLivingBase user) {
    InventoryPickaxe inp = new InventoryPickaxe(ist, false);
    if (inp.canDecreaseDamage(ist)) return;

    ist.damageItem(1, user);
  }
コード例 #3
0
 private boolean isInvHasEffect(ItemStack ist) {
   InventoryPickaxe inp = new InventoryPickaxe(ist, false);
   return inp.hasEffect();
 }