diff --git a/src/main/java/net/md_5/bungee/BungeeCord.java b/src/main/java/net/md_5/bungee/BungeeCord.java index 02a70dc8..bcb93bfc 100644 --- a/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/src/main/java/net/md_5/bungee/BungeeCord.java @@ -89,6 +89,7 @@ public class BungeeCord { + commandMap.put("greload",new CommandReload()); commandMap.put("end", new CommandEnd()); commandMap.put("glist", new CommandList()); commandMap.put("server", new CommandServer()); @@ -194,7 +195,10 @@ public class BungeeCord saveThread.start(); $().info("Listening on " + addr); - new Metrics().start(); + if (config.metricsEnabled) + { + new Metrics().start(); + } } /** diff --git a/src/main/java/net/md_5/bungee/Configuration.java b/src/main/java/net/md_5/bungee/Configuration.java index 333a6f02..c199cae6 100644 --- a/src/main/java/net/md_5/bungee/Configuration.java +++ b/src/main/java/net/md_5/bungee/Configuration.java @@ -132,6 +132,7 @@ public class Configuration * UUID for Metrics. */ public String statsUuid = UUID.randomUUID().toString(); + public boolean metricsEnabled = true; /** * Load the configuration and save default values. diff --git a/src/main/java/net/md_5/bungee/command/CommandReload.java b/src/main/java/net/md_5/bungee/command/CommandReload.java new file mode 100644 index 00000000..18c922d0 --- /dev/null +++ b/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -0,0 +1,21 @@ +package net.md_5.bungee.command; + +import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.ChatColor; +import net.md_5.bungee.Permission; + +public class CommandReload extends Command +{ + + @Override + public void execute(CommandSender sender, String[] args) + { + if (getPermission(sender) != Permission.ADMIN) + { + sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!"); + return; + } + BungeeCord.instance.config.load(); + sender.sendMessage(ChatColor.GREEN + "Reloaded config, please restart if you have any issues"); + } +}