World Blacklist cleanup, metric config pt 2

This commit is contained in:
nossr50 2019-03-14 21:28:23 -07:00
parent 96b781ab0a
commit fb1467551f
4 changed files with 14 additions and 23 deletions

View File

@ -436,15 +436,6 @@ public class MainConfig extends ConfigValidated {
*/ */
/* General Settings */ /* General Settings */
public boolean getIsMetricsEnabled() {
return getBooleanValue(METRICS, BSTATS);
}
//Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
public boolean getIsRetroMode() {
return getBooleanValue(GENERAL, RETRO_MODE, ENABLED);
}
public String getLocale() { public String getLocale() {
if(hasNode(GENERAL, LOCALE)) if(hasNode(GENERAL, LOCALE))
return getStringValue(GENERAL, LOCALE); return getStringValue(GENERAL, LOCALE);

View File

@ -13,7 +13,6 @@ import java.util.ArrayList;
public class WorldBlacklist { public class WorldBlacklist {
public static boolean isWorldBlacklisted(World world) { public static boolean isWorldBlacklisted(World world) {
for (String s : mcMMO.getConfigManager().getConfigWorldBlacklist().getBlackListedWorlds()) { for (String s : mcMMO.getConfigManager().getConfigWorldBlacklist().getBlackListedWorlds()) {
if (world.getName().equalsIgnoreCase(s)) if (world.getName().equalsIgnoreCase(s))
return true; return true;

View File

@ -1,8 +1,20 @@
package com.gmail.nossr50.config.hocon.metrics; package com.gmail.nossr50.config.hocon.metrics;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable @ConfigSerializable
public class ConfigMetrics { public class ConfigMetrics {
public static final boolean ALLOW_STAT_TRACKING_DEFAULT = true;
@Setting(value = "Allow-Anonymous-Statistic-Collection", comment = "Collects info about what version of mcMMO you are using and other information" +
"\nAll information is completely anonymous, and that info is reported to bstats for data processing." +
"\nThis setting should have no affect on your server whatsoever, so I'd like to discourage you from turning it off." +
"\nDefault value: "+ALLOW_STAT_TRACKING_DEFAULT)
private boolean allowAnonymousUsageStatistics = ALLOW_STAT_TRACKING_DEFAULT;
public boolean isAllowAnonymousUsageStatistics() {
return allowAnonymousUsageStatistics;
}
} }

View File

@ -57,9 +57,6 @@ public class mcMMO extends JavaPlugin {
private static HolidayManager holidayManager; private static HolidayManager holidayManager;
//private static UpgradeManager upgradeManager; //private static UpgradeManager upgradeManager;
/* Blacklist */
private static WorldBlacklist worldBlacklist;
/* File Paths */ /* File Paths */
private static String mainDirectory; private static String mainDirectory;
private static String flatFileDirectory; private static String flatFileDirectory;
@ -163,10 +160,9 @@ public class mcMMO extends JavaPlugin {
RankUtils.populateRanks(); RankUtils.populateRanks();
//If anonymous statistics are enabled then use them //If anonymous statistics are enabled then use them
if(getConfigManager().getConfigMetrics().isAllowAnonymousUsageStatistics()) {
Metrics metrics; Metrics metrics;
if(MainConfig.getInstance().getIsMetricsEnabled()) {
metrics = new Metrics(this); metrics = new Metrics(this);
metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion())); metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion()));
@ -184,9 +180,6 @@ public class mcMMO extends JavaPlugin {
getServer().getPluginManager().disablePlugin(this); getServer().getPluginManager().disablePlugin(this);
} }
//Init the blacklist
worldBlacklist = new WorldBlacklist();
} }
@Override @Override
@ -542,10 +535,6 @@ public class mcMMO extends JavaPlugin {
return getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled(); return getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled();
} }
public static WorldBlacklist getWorldBlacklist() {
return worldBlacklist;
}
public static ConfigManager getConfigManager() { public static ConfigManager getConfigManager() {
return configManager; return configManager;
} }