This commit is contained in:
sauilitired 2015-05-24 03:00:16 +02:00
parent df5167813a
commit 81806a06f4
2 changed files with 13 additions and 4 deletions

View File

@ -22,6 +22,7 @@ package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import com.intellectualcrafters.plot.config.C;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -49,7 +50,6 @@ public class Inventory extends SubCommand {
for (final SubCommand cmd : cmds) {
inventory.addItem(getItem(cmd));
}
// FIXME unchecked cast
((BukkitPlayer) plr).player.openInventory(inventory);
return true;
}
@ -61,9 +61,9 @@ public class Inventory extends SubCommand {
meta.setDisplayName(ChatColor.GREEN + cmd.cmd + ChatColor.DARK_GRAY + " [" + ChatColor.GREEN + cmd.alias + ChatColor.DARK_GRAY + "]");
meta.setLore(new ArrayList<String>() {
{
add(ChatColor.RED + "Category: " + ChatColor.GOLD + cmd.category.toString());
add(ChatColor.RED + "Description: " + ChatColor.GOLD + cmd.description);
add(ChatColor.RED + "Usage: " + ChatColor.GOLD + "/plot " + cmd.usage);
add(C.INVENTORY_CATEGORY.s().replace("{category}", cmd.category.toString()));
add(C.INVENTORY_DESC.s().replace("{desc}", cmd.description));
add(C.INVENTORY_USAGE.s().replace("{usage}", "/plot " + cmd.usage));
}
});
}

View File

@ -35,6 +35,7 @@ import com.intellectualsites.translation.bukkit.BukkitTranslation;
* @author Citymonstret
*/
public enum C {
/*
* Confirm
*/
@ -126,6 +127,14 @@ public enum C {
*/
NOT_CONSOLE("$2For safety reasons, this command can only be executed by console.", "Console"),
IS_CONSOLE("$2This command can only be executed by a player.", "Console"),
/*
Inventory
*/
INVENTORY_USAGE("&cUsage: &6{usage}", "Inventory"),
INVENTORY_DESC("&cDescription: &6{desc}", "Inventory"),
INVENTORY_CATEGORY("&cCategory: &6{category}", "Inventory"),
/*
* Clipboard
*/