Add greload command and option to disable metrics.
This commit is contained in:
parent
aba35a3b2b
commit
b0faea5254
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
|
21
src/main/java/net/md_5/bungee/command/CommandReload.java
Normal file
21
src/main/java/net/md_5/bungee/command/CommandReload.java
Normal file
@ -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");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user