From 81806a06f4250b83fc895ca87ad72261b72a3ca7 Mon Sep 17 00:00:00 2001 From: sauilitired Date: Sun, 24 May 2015 03:00:16 +0200 Subject: [PATCH] Fixed #310 --- .../intellectualcrafters/plot/commands/Inventory.java | 8 ++++---- .../java/com/intellectualcrafters/plot/config/C.java | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inventory.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inventory.java index da6f47752..c06968920 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inventory.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inventory.java @@ -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() { { - 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)); } }); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 64c71bd0d..0a0e3e706 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -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 */