use of com.earth2me.essentials.metrics.Metrics in project Essentials by drtshock.
the class Commandessentials method run_optout.
private void run_optout(final Server server, final CommandSource sender, final String command, final String[] args) {
final Metrics metrics = ess.getMetrics();
sender.sendMessage("Essentials collects simple metrics to highlight which features to concentrate work on in the future.");
if (metrics.isOptOut()) {
metrics.enable();
} else {
metrics.disable();
}
sender.sendMessage("Anonymous Metrics are now " + (metrics.isOptOut() ? "disabled" : "enabled") + " for EssentialsX until server restart.");
sender.sendMessage("To " + (metrics.isOptOut() ? "disable" : "enable") + " them for all plugins permanently, see the bStats config.");
}
use of com.earth2me.essentials.metrics.Metrics in project Essentials by EssentialsX.
the class Commandessentials method run_optout.
private void run_optout(final Server server, final CommandSource sender, final String command, final String[] args) {
final Metrics metrics = ess.getMetrics();
sender.sendMessage("Essentials collects simple metrics to highlight which features to concentrate work on in the future.");
if (metrics.isOptOut()) {
metrics.enable();
} else {
metrics.disable();
}
sender.sendMessage("Anonymous Metrics are now " + (metrics.isOptOut() ? "disabled" : "enabled") + " for EssentialsX until server restart.");
sender.sendMessage("To " + (metrics.isOptOut() ? "disable" : "enable") + " them for all plugins permanently, see the bStats config.");
}
use of com.earth2me.essentials.metrics.Metrics in project Essentials by EssentialsX.
the class Essentials method onEnable.
@Override
public void onEnable() {
try {
if (LOGGER != this.getLogger()) {
LOGGER.setParent(this.getLogger());
}
execTimer = new ExecuteTimer();
execTimer.start();
i18n = new I18n(this);
i18n.onEnable();
execTimer.mark("I18n1");
Console.setInstance(this);
final PluginManager pm = getServer().getPluginManager();
for (Plugin plugin : pm.getPlugins()) {
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {
getLogger().warning(tl("versionMismatch", plugin.getDescription().getName()));
}
}
for (Method method : Server.class.getDeclaredMethods()) {
if (method.getName().endsWith("getOnlinePlayers") && method.getReturnType() == Player[].class) {
oldGetOnlinePlayers = method;
break;
}
}
forceLoadClasses();
try {
final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
upgrade.beforeSettings();
execTimer.mark("Upgrade");
confList = new ArrayList<>();
settings = new Settings(this);
confList.add(settings);
execTimer.mark("Settings");
userMap = new UserMap(this);
confList.add(userMap);
execTimer.mark("Init(Usermap)");
kits = new Kits(this);
confList.add(kits);
upgrade.convertKits();
execTimer.mark("Kits");
upgrade.afterSettings();
execTimer.mark("Upgrade2");
warps = new Warps(getServer(), this.getDataFolder());
confList.add(warps);
execTimer.mark("Init(Spawn/Warp)");
worth = new Worth(this.getDataFolder());
confList.add(worth);
itemDb = new ItemDb(this);
confList.add(itemDb);
execTimer.mark("Init(Worth/ItemDB)");
jails = new Jails(this);
confList.add(jails);
spawnerProvider = new ProviderFactory<>(getLogger(), Arrays.asList(BlockMetaSpawnerProvider.class, v1_8_R2SpawnerProvider.class, v1_8_R1SpawnerProvider.class, LegacySpawnerProvider.class), "mob spawner").getProvider();
spawnEggProvider = new ProviderFactory<>(getLogger(), Arrays.asList(ReflSpawnEggProvider.class, LegacySpawnEggProvider.class), "spawn egg").getProvider();
potionMetaProvider = new ProviderFactory<>(getLogger(), Arrays.asList(BasePotionDataProvider.class, LegacyPotionMetaProvider.class), "potion meta").getProvider();
reload();
} catch (YAMLException exception) {
if (pm.getPlugin("EssentialsUpdate") != null) {
LOGGER.log(Level.SEVERE, tl("essentialsHelp2"));
} else {
LOGGER.log(Level.SEVERE, tl("essentialsHelp1"));
}
handleCrash(exception);
return;
}
backup = new Backup(this);
permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
timer = new EssentialsTimer(this);
scheduleSyncRepeatingTask(timer, 1000, 50);
Economy.setEss(this);
execTimer.mark("RegHandler");
metrics = new Metrics(this);
if (!metrics.isOptOut()) {
getLogger().info("Starting Metrics. Opt-out using the global bStats config.");
} else {
getLogger().info("Metrics disabled per bStats config.");
}
final String timeroutput = execTimer.end();
if (getSettings().isDebug()) {
LOGGER.log(Level.INFO, "Essentials load {0}", timeroutput);
}
} catch (NumberFormatException ex) {
handleCrash(ex);
} catch (Error ex) {
handleCrash(ex);
throw ex;
}
}
use of com.earth2me.essentials.metrics.Metrics in project Essentials by drtshock.
the class Essentials method onEnable.
@Override
public void onEnable() {
try {
if (LOGGER != this.getLogger()) {
LOGGER.setParent(this.getLogger());
}
execTimer = new ExecuteTimer();
execTimer.start();
i18n = new I18n(this);
i18n.onEnable();
execTimer.mark("I18n1");
Console.setInstance(this);
final PluginManager pm = getServer().getPluginManager();
for (Plugin plugin : pm.getPlugins()) {
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {
getLogger().warning(tl("versionMismatch", plugin.getDescription().getName()));
}
}
for (Method method : Server.class.getDeclaredMethods()) {
if (method.getName().endsWith("getOnlinePlayers") && method.getReturnType() == Player[].class) {
oldGetOnlinePlayers = method;
break;
}
}
forceLoadClasses();
try {
final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
upgrade.beforeSettings();
execTimer.mark("Upgrade");
confList = new ArrayList<>();
settings = new Settings(this);
confList.add(settings);
execTimer.mark("Settings");
userMap = new UserMap(this);
confList.add(userMap);
execTimer.mark("Init(Usermap)");
kits = new Kits(this);
confList.add(kits);
upgrade.convertKits();
execTimer.mark("Kits");
upgrade.afterSettings();
execTimer.mark("Upgrade2");
warps = new Warps(getServer(), this.getDataFolder());
confList.add(warps);
execTimer.mark("Init(Spawn/Warp)");
worth = new Worth(this.getDataFolder());
confList.add(worth);
itemDb = new ItemDb(this);
confList.add(itemDb);
execTimer.mark("Init(Worth/ItemDB)");
jails = new Jails(this);
confList.add(jails);
spawnerProvider = new ProviderFactory<>(getLogger(), Arrays.asList(BlockMetaSpawnerProvider.class, v1_8_R2SpawnerProvider.class, v1_8_R1SpawnerProvider.class, LegacySpawnerProvider.class), "mob spawner").getProvider();
spawnEggProvider = new ProviderFactory<>(getLogger(), Arrays.asList(ReflSpawnEggProvider.class, LegacySpawnEggProvider.class), "spawn egg").getProvider();
potionMetaProvider = new ProviderFactory<>(getLogger(), Arrays.asList(BasePotionDataProvider.class, LegacyPotionMetaProvider.class), "potion meta").getProvider();
reload();
} catch (YAMLException exception) {
if (pm.getPlugin("EssentialsUpdate") != null) {
LOGGER.log(Level.SEVERE, tl("essentialsHelp2"));
} else {
LOGGER.log(Level.SEVERE, tl("essentialsHelp1"));
}
handleCrash(exception);
return;
}
backup = new Backup(this);
permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
timer = new EssentialsTimer(this);
scheduleSyncRepeatingTask(timer, 1000, 50);
Economy.setEss(this);
execTimer.mark("RegHandler");
metrics = new Metrics(this);
if (!metrics.isOptOut()) {
getLogger().info("Starting Metrics. Opt-out using the global bStats config.");
} else {
getLogger().info("Metrics disabled per bStats config.");
}
final String timeroutput = execTimer.end();
if (getSettings().isDebug()) {
LOGGER.log(Level.INFO, "Essentials load {0}", timeroutput);
}
} catch (NumberFormatException ex) {
handleCrash(ex);
} catch (Error ex) {
handleCrash(ex);
throw ex;
}
}
Aggregations