From 0af5d198f5c72f5517f37a36a8ab2bdf2fe5418d Mon Sep 17 00:00:00 2001 From: DoctorDark Date: Sun, 7 Dec 2014 14:49:32 +0000 Subject: Fix case sensitive arguments, show usage message if no arguments found for the timings command --- src/main/java/org/bukkit/command/defaults/TimingsCommand.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java index 05cfcb01..a39ea5dd 100644 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java @@ -41,8 +41,8 @@ public class TimingsCommand extends BukkitCommand { return true; } - boolean separate = "separate".equals(args[0]); - if ("reset".equals(args[0])) { + boolean separate = "separate".equalsIgnoreCase(args[0]); + if ("reset".equalsIgnoreCase(args[0])) { for (HandlerList handlerList : HandlerList.getHandlerLists()) { for (RegisteredListener listener : handlerList.getRegisteredListeners()) { if (listener instanceof TimedRegisteredListener) { @@ -51,7 +51,7 @@ public class TimingsCommand extends BukkitCommand { } } sender.sendMessage("Timings reset"); - } else if ("merged".equals(args[0]) || separate) { + } else if ("merged".equalsIgnoreCase(args[0]) || separate) { int index = 0; int pluginIdx = 0; @@ -103,6 +103,9 @@ public class TimingsCommand extends BukkitCommand { fileNames.close(); } } + } else { + sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); + return false; } return true; } -- cgit v1.2.3