mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-09-10 05:08:04 +02:00
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("end", new CommandEnd());
|
||||||
commandMap.put("glist", new CommandList());
|
commandMap.put("glist", new CommandList());
|
||||||
commandMap.put("server", new CommandServer());
|
commandMap.put("server", new CommandServer());
|
||||||
@ -194,7 +195,10 @@ public class BungeeCord
|
|||||||
saveThread.start();
|
saveThread.start();
|
||||||
$().info("Listening on " + addr);
|
$().info("Listening on " + addr);
|
||||||
|
|
||||||
new Metrics().start();
|
if (config.metricsEnabled)
|
||||||
|
{
|
||||||
|
new Metrics().start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,6 +132,7 @@ public class Configuration
|
|||||||
* UUID for Metrics.
|
* UUID for Metrics.
|
||||||
*/
|
*/
|
||||||
public String statsUuid = UUID.randomUUID().toString();
|
public String statsUuid = UUID.randomUUID().toString();
|
||||||
|
public boolean metricsEnabled = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the configuration and save default values.
|
* 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