Also add the cancel feature for the Salvage Anvil

This commit is contained in:
TfT_02 2013-04-25 23:40:21 +02:00
parent 68a7b540c5
commit bdc753f03c

View File

@ -365,6 +365,16 @@ public class PlayerListener implements Listener {
player.sendMessage(ChatColor.RED + "Repair cancelled!"); //TODO Locale!
}
}
/* SALVAGE CHECKS */
else if (blockID == Repair.salvageAnvilId && Permissions.salvage(player) && Repair.isSalvageable(heldItem)) {
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
// Cancel salvaging an enchanted item
if (repairManager.checkConfirmation(blockID, false) && Config.getInstance().getRepairConfirmRequired()) {
UserManager.getPlayer(player).setLastAnvilUse(Repair.salvageAnvilId, 0);
player.sendMessage(ChatColor.RED + "Salvage cancelled!"); //TODO Locale!
}
}
break;