3536373839404142434445
PlayerInventory inventory = player.getInventory(); boolean itemConsumed = false; int idx = inventory.first(itemID); if (idx >= 0) { ItemStack toConsume = inventory.getItem(idx); int amt = toConsume.getAmount(); if (amt > 0) {
132133134135136137138139140141142
addEnchants(item); } // Remove the item if (repairMaterialMetadata == -1) { toRemove = inventory.getItem(inventory.first(repairMaterial)).clone(); toRemove.setAmount(1); } inventory.removeItem(toRemove);