From 264b2ef8a200b48ce322a8ea3afb8901affc464b Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 15 Jun 2014 14:52:45 +1200 Subject: [PATCH] Tell the user how many options they ignored. --- .../disguise/commands/DisguiseHelpCommand.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java index dc787dd2..b33bbef9 100644 --- a/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java +++ b/src/me/libraryaddict/disguise/commands/DisguiseHelpCommand.java @@ -158,6 +158,7 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { ArrayList methods = new ArrayList(); HashMap map = new HashMap(); Class watcher = type.getWatcherClass(); + int ignored = 0; try { for (Method method : watcher.getMethods()) { if (!method.getName().startsWith("get") && method.getParameterTypes().length == 1 @@ -176,6 +177,7 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { } } if (!allowed) { + ignored++; continue; } } @@ -233,6 +235,10 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { } sender.sendMessage(ChatColor.DARK_RED + type.toReadable() + " options: " + StringUtils.join(methods, ChatColor.DARK_RED + ", ")); + if (ignored > 0) { + sender.sendMessage(ChatColor.RED + "Ignored " + ignored + + " options you do not have permission to view. Add 'show' to view unusable options."); + } return true; } }