diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java index 75a14fed..9ac5e6b9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java @@ -23,7 +23,7 @@ public class DebugCommand extends MultiverseCommand { public DebugCommand(MultiverseCore plugin) { super(plugin); this.setName("Turn Debug on/off?"); - this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off]"); + this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off|-1]"); this.setArgRange(0, 1); this.addKey("mv debug"); this.addKey("mv d"); @@ -40,13 +40,13 @@ public class DebugCommand extends MultiverseCommand { } else { try { int debugLevel = Integer.parseInt(args.get(0)); - if (debugLevel > 3 || debugLevel < 0) { + if (debugLevel > 3 || debugLevel < -1) { throw new NumberFormatException(); } plugin.getMVConfig().setGlobalDebug(debugLevel); } catch (NumberFormatException e) { sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE - + " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)"); + + " setting debug level. Please use a number 0-3 or -1 " + ChatColor.AQUA + "(3 being many many messages! -1 disables common messages!)"); } } plugin.saveMVConfigs(); @@ -55,11 +55,14 @@ public class DebugCommand extends MultiverseCommand { } private void displayDebugMode(CommandSender sender) { - if (plugin.getMVConfig().getGlobalDebug() == 0) { + final int debugLevel = plugin.getMVConfig().getGlobalDebug(); + if (debugLevel == 0) { sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF"); - } else { - sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + plugin.getMVConfig().getGlobalDebug()); + } else if (debugLevel > 0) { + sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel); this.plugin.log(Level.FINE, "Multiverse Debug ENABLED"); + } else { + sender.sendMessage("Multiverse Debug mode is" + ChatColor.GRAY + " disabling common startup messages!"); } } }