return true;
}
private boolean doCutGem(Player player, final InvItem chisel,
final InvItem gem) {
final ItemGemDef gemDef = EntityHandler.getItemGemDef(gem.id);
if (gemDef == null) {
return false;
}
if (player.getCurStat(12) < gemDef.getReqLevel()) {
player.getActionSender().sendMessage(
"You need a crafting level of " + gemDef.getReqLevel()
+ " to cut this gem");
return true;
}
Instance.getDelayedEventHandler().add(new MiniEvent(player) {
public void action() {
if (owner.getInventory().remove(gem.id, gem.amount, false)) {
InvItem cutGem = new InvItem(gemDef.getGemID(), 1);
owner.getActionSender().sendMessage(
"You cut the " + cutGem.getDef().getName());
owner.getActionSender().sendSound("chisel");
owner.getInventory().add(cutGem.id, cutGem.amount, false);
owner.incExp(12, gemDef.getExp(), true);
owner.getActionSender().sendStat(12);
owner.getActionSender().sendInventory();
}
}
});