mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-09 15:30:45 +00:00
添加统计功能
This commit is contained in:
@ -2,7 +2,9 @@ package gg.frog.mc.permissionstime;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.mcstats.Metrics;
|
||||
|
||||
import gg.frog.mc.permissionstime.command.TheCommand;
|
||||
import gg.frog.mc.permissionstime.config.ConfigManager;
|
||||
@ -22,17 +24,29 @@ public class PluginMain extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
pm = this;
|
||||
cm = new ConfigManager();
|
||||
registerListeners();
|
||||
registerCommands();
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " " + PluginMain.PLUGIN_NAME + " v" + PluginMain.PLUGIN_VERSION));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " author:GeekFrog QQ:324747460"));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " https://github.com/geekfrog/PermissionsTime/ "));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
||||
if (!checkPluginDepends()) {
|
||||
|
||||
} else {
|
||||
pm = this;
|
||||
cm = new ConfigManager();
|
||||
registerListeners();
|
||||
registerCommands();
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " " + PluginMain.PLUGIN_NAME + " v" + PluginMain.PLUGIN_VERSION));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " author:GeekFrog QQ:324747460"));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + " https://github.com/geekfrog/PermissionsTime/ "));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX));
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
||||
if(PluginCfg.IS_METRICS){
|
||||
try {
|
||||
Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PluginMain getInstance() {
|
||||
@ -58,4 +72,9 @@ public class PluginMain extends JavaPlugin {
|
||||
public ConfigManager getConfigManager() {
|
||||
return cm;
|
||||
}
|
||||
|
||||
private boolean checkPluginDepends() {
|
||||
// return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user