list = list.substring(0, list.length() - 2);
sender.sendMessageToPlayer(FontColour.GREEN + "Enchantments [name (id)]:");
sender.sendMessageToPlayer(list);
} else if (argument.equalsIgnoreCase("add")) {
if (params.size() == 1) {
throw new CommandException(getUsage(sender));
}
int id = -1;
try {
id = Integer.parseInt((String)params.get(1));
} catch (Exception e) {
id = getEnchantmentId((String)params.get(1));
}
if (id < 0) {
throw new CommandException("Invalid enchantment specified.");
}
int level = 1;
if (params.size() == 3) {
level = (Integer)params.get(2);
}
String name = null;
if ((name = Item.addEnchantmentToCurrentItem(getSenderAsPlayer(sender), id, level)) == null) {
throw new CommandException("Unable to add the specified enchantment with ID " + id);
}
getSenderAsPlayer(sender).sendChatMessage("The " + FontColour.AQUA +
name + FontColour.WHITE + " command was successfully added.");
} else {
Item.removeEnchantmentsOnCurrentItem(getSenderAsPlayer(sender));