Add bStats Metrics

This commit is contained in:
Frank van der Heijden 2020-06-07 17:41:02 +02:00
parent 9e8ac2d4fe
commit 4419dc6d7f
No known key found for this signature in database
GPG key ID: 26DA56488D314D11

View file

@ -5,6 +5,7 @@ import net.frankheijden.serverutils.commands.CommandPlugins;
import net.frankheijden.serverutils.commands.CommandServerUtils; import net.frankheijden.serverutils.commands.CommandServerUtils;
import net.frankheijden.serverutils.config.Messenger; import net.frankheijden.serverutils.config.Messenger;
import net.frankheijden.serverutils.reflection.*; import net.frankheijden.serverutils.reflection.*;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.*; import org.bukkit.command.*;
import org.bukkit.command.defaults.PluginsCommand; import org.bukkit.command.defaults.PluginsCommand;
@ -19,6 +20,8 @@ import java.util.stream.Collectors;
public class ServerUtils extends JavaPlugin implements CommandExecutor { public class ServerUtils extends JavaPlugin implements CommandExecutor {
private static final int BSTATS_METRICS_ID = 7790;
private static ServerUtils instance; private static ServerUtils instance;
private PaperCommandManager commandManager; private PaperCommandManager commandManager;
private CommandPlugins commandPlugins; private CommandPlugins commandPlugins;
@ -32,6 +35,8 @@ public class ServerUtils extends JavaPlugin implements CommandExecutor {
super.onEnable(); super.onEnable();
instance = this; instance = this;
new Metrics(this, BSTATS_METRICS_ID);
this.commandManager = new PaperCommandManager(this); this.commandManager = new PaperCommandManager(this);
commandManager.registerCommand(new CommandServerUtils()); commandManager.registerCommand(new CommandServerUtils());
this.commandPlugins = null; this.commandPlugins = null;