public void craftLeather(int id) { LeatherCrafting lea = LeatherCrafting.forId(id); if (lea == null) { return; } if (c.playerLevel[c.playerCrafting] >= lea.getReqLevel()) { if (c.getItems().playerHasItem(lea.getLeather(), lea.getReqAmt())) { c.startAnimation(1249); c.getItems().deleteItem(lea.getLeather(), lea.getReqAmt()); c.getItems().addItem(lea.getOutcome(), 1); c.getPA().addSkillXP(lea.getXP(), c.playerCrafting); resetCrafting(); } else { c.sendMessage("You do not have enough items to craft this item."); } } else { c.sendMessage("You need a crafting level of " + lea.getReqLevel() + " to craft this item."); } c.getPA().removeAllWindows(); }
static { for (LeatherCrafting l : LeatherCrafting.values()) { lea.put(l.getOutcome(), l); } }