From c600ab6dd1158702b00feed5376b5a76c4be36e8 Mon Sep 17 00:00:00 2001 From: Mats Date: Tue, 8 Mar 2016 13:30:26 +0100 Subject: [PATCH] Add /viaversion debug to the commandlist --- .../commands/ViaVersionCommand.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java b/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java index 61c0e3eaa..43b29f2a1 100644 --- a/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java +++ b/src/main/java/us/myles/ViaVersion/commands/ViaVersionCommand.java @@ -20,16 +20,11 @@ public class ViaVersionCommand implements CommandExecutor { private final ViaVersionPlugin plugin; - @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender.hasPermission("viaversion.admin")) { if (args.length == 0) { - sender.sendMessage(color("&aViaVersion &c" + ViaVersion.getInstance().getVersion())); - sender.sendMessage(color("&6Commands:")); - sender.sendMessage(color("&2/viaversion list &7- &6Shows lists of all 1.9 clients and 1.8 clients.")); - sender.sendMessage(color("&2/viaversion autoteam &7- &6Toggle automatically teaming to prevent colliding.")); - sender.sendMessage(color("&2/viaversion dontbugme &7- &6Toggle checking for updates.")); + sendHelp(sender); } else if (args.length == 1) { if (args[0].equalsIgnoreCase("list")) { List portedPlayers = new ArrayList<>(); @@ -59,11 +54,7 @@ public class ViaVersionCommand implements CommandExecutor { sender.sendMessage(color("&6We will " + (newValue ? "&aautomatically team players" : "&cno longer auto team players"))); sender.sendMessage(color("&6All players will need to re-login for the change to take place.")); } else { - sender.sendMessage(color("&aViaVersion &c" + ViaVersion.getInstance().getVersion())); - sender.sendMessage(color("&6Commands:")); - sender.sendMessage(color("&2/viaversion list &7- &6Shows lists of all 1.9 clients and 1.8 clients.")); - sender.sendMessage(color("&2/viaversion autoteam &7- &6Toggle automatically teaming to prevent colliding.")); - sender.sendMessage(color("&2/viaversion dontbugme &7- &6Toggle checking for updates.")); + sendHelp(sender); } } @@ -71,6 +62,15 @@ public class ViaVersionCommand implements CommandExecutor { return false; } + public void sendHelp(CommandSender sender){ + sender.sendMessage(color("&aViaVersion &c" + ViaVersion.getInstance().getVersion())); + sender.sendMessage(color("&6Commands:")); + sender.sendMessage(color("&2/viaversion list &7- &6Shows lists of all 1.9 clients and 1.8 clients.")); + sender.sendMessage(color("&2/viaversion debug &7- &6Toggle debug mode")); + sender.sendMessage(color("&2/viaversion autoteam &7- &6Toggle automatically teaming to prevent colliding.")); + sender.sendMessage(color("&2/viaversion dontbugme &7- &6Toggle checking for updates.")); + } + public String color(String string) { return string.replace("&", "ยง"); }