|| player.getItemInHand().getType().equals(Material.AIR)) {
sender.sendMessage(ChatColor.RED + "Not enough arguments.");
return true;
}
ItemStack tool = player.getItemInHand();
ItemMeta meta = tool.getItemMeta();
if (args[1].equalsIgnoreCase("lore")) {
if (args[2].equalsIgnoreCase("clear")) {
meta.setLore(null);
tool.setItemMeta(meta);
player.sendMessage(ChatColor.GREEN
+ "Cleared the lore for the item!");
return true;
}
String lore = combineSplit(2, args);
lore = ChatColor.translateAlternateColorCodes(
"&".toCharArray()[0], lore);
meta.setLore(Arrays.asList(lore.split(",")));
tool.setItemMeta(meta);
player.sendMessage(ChatColor.GREEN
+ "Set the lore for the item!");
return true;
} else if (args[1].equalsIgnoreCase("name")) {
if (args[2].equalsIgnoreCase("clear")) {
tool.getItemMeta().setDisplayName(null);
player.sendMessage(ChatColor.GREEN
+ "Cleared the name for the item!");
return true;
}
String name = combineSplit(2, args);
name = ChatColor.translateAlternateColorCodes(
"&".toCharArray()[0], name);
meta.setDisplayName(name);
tool.setItemMeta(meta);
player.sendMessage(ChatColor.GREEN
+ "Set the name for the item!");
return true;
} else if (args[1].equalsIgnoreCase("enchant")) {