diff --git a/core/src/main/java/com/boydti/fawe/config/BBC.java b/core/src/main/java/com/boydti/fawe/config/BBC.java index d30feb40..25f4dd0f 100644 --- a/core/src/main/java/com/boydti/fawe/config/BBC.java +++ b/core/src/main/java/com/boydti/fawe/config/BBC.java @@ -215,6 +215,8 @@ public enum BBC { COMMAND_INVALID_SYNTAX("The command was not used properly (no more help available).", "WorldEdit.Command"), HELP_HEADER_CATEGORIES("Command Types", "WorldEdit.Help"), + HELP_ITEM_ALLOWED("&a%s0&8 - &7%s1", "WorldEdit.Help"), + HELP_ITEM_DENIED("&c%s0&8 - &7%s1", "WorldEdit.Help"), HELP_HEADER("Help: page %s0/%s1", "WorldEdit.Help"), HELP_HEADER_FOOTER("&7Use: &8//help [type|command] [#]&7\n&7Wiki: https://git.io/vSKE5", "WorldEdit.Help"), diff --git a/core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index b2cd5dd9..05978813 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -649,7 +649,9 @@ public class UtilityCommands { StringBuilder builder = new StringBuilder(); boolean first = true; for (Map.Entry> entry : grouped.entrySet()) { - message.append("&a/" + cmd + " " + entry.getKey() + "&8 - &7" + entry.getValue().size() + "\n"); + String s1 = "&a/" + cmd + " " + entry.getKey(); + String s2 = entry.getValue().size() + ""; + message.append(BBC.HELP_ITEM_ALLOWED.format(s1, s2) + "\n"); } message.append(BBC.HELP_HEADER_FOOTER.s()); actor.print(BBC.color(message.toString())); @@ -677,21 +679,21 @@ public class UtilityCommands { // Add each command for (CommandMapping mapping : list) { CommandCallable c = mapping.getCallable(); - boolean perm = c.testPermission(locals); -// String primary = BBC.color(perm ? "&2" : "&4"); - String color = BBC.color(perm ? "&a" : "&c"); - message.append(color); + StringBuilder s1 = new StringBuilder(); if (isRootLevel) { - message.append("/"); + s1.append("/"); } if (!visited.isEmpty()) { - message.append(Joiner.on(" ").join(visited)); - message.append(" "); + s1.append(Joiner.on(" ").join(visited)); + s1.append(" "); + } + s1.append(mapping.getPrimaryAlias()); + String s2 = mapping.getDescription().getDescription(); + if (c.testPermission(locals)) { + message.append(BBC.HELP_ITEM_ALLOWED.format(s1, s2) + "\n"); + } else { + message.append(BBC.HELP_ITEM_DENIED.format(s1, s2) + "\n"); } - message.append(mapping.getPrimaryAlias()); - message.append("&8 - &7"); - message.append(mapping.getDescription().getDescription()); - message.append('\n'); } message.append(BBC.HELP_HEADER_FOOTER.f()); }