From fc72197f869161a4f50de629e8d80c8959732c57 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 14 Jan 2015 10:35:13 +1100 Subject: [PATCH] Only show relevant commands --- .../intellectualcrafters/plot/commands/MainCommand.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index cbce58838..28bb15384 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -65,9 +65,11 @@ public class MainCommand implements CommandExecutor, TabCompleter { public static List getCommands(final SubCommand.CommandCategory category, final Player player) { final List cmds = new ArrayList<>(); for (final SubCommand c : subCommands) { - if ((c.category.equals(category)) && c.permission.hasPermission(player)) { - cmds.add(c); - } + if (!c.isPlayer || player != null) { + if ((c.category.equals(category)) && c.permission.hasPermission(player)) { + cmds.add(c); + } + } } return cmds; }