mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	World Blacklist cleanup, metric config pt 2
This commit is contained in:
		@@ -436,15 +436,6 @@ public class MainConfig extends ConfigValidated {
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /* 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() {
 | 
			
		||||
        if(hasNode(GENERAL, LOCALE))
 | 
			
		||||
            return getStringValue(GENERAL, LOCALE);
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,6 @@ import java.util.ArrayList;
 | 
			
		||||
public class WorldBlacklist {
 | 
			
		||||
 | 
			
		||||
    public static boolean isWorldBlacklisted(World world) {
 | 
			
		||||
 | 
			
		||||
        for (String s : mcMMO.getConfigManager().getConfigWorldBlacklist().getBlackListedWorlds()) {
 | 
			
		||||
            if (world.getName().equalsIgnoreCase(s))
 | 
			
		||||
                return true;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,20 @@
 | 
			
		||||
package com.gmail.nossr50.config.hocon.metrics;
 | 
			
		||||
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.Setting;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
 | 
			
		||||
 | 
			
		||||
@ConfigSerializable
 | 
			
		||||
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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -57,9 +57,6 @@ public class mcMMO extends JavaPlugin {
 | 
			
		||||
    private static HolidayManager     holidayManager;
 | 
			
		||||
    //private static UpgradeManager     upgradeManager;
 | 
			
		||||
 | 
			
		||||
    /* Blacklist */
 | 
			
		||||
    private static WorldBlacklist worldBlacklist;
 | 
			
		||||
 | 
			
		||||
    /* File Paths */
 | 
			
		||||
    private static String mainDirectory;
 | 
			
		||||
    private static String flatFileDirectory;
 | 
			
		||||
@@ -163,10 +160,9 @@ public class mcMMO extends JavaPlugin {
 | 
			
		||||
            RankUtils.populateRanks();
 | 
			
		||||
 | 
			
		||||
            //If anonymous statistics are enabled then use them
 | 
			
		||||
 | 
			
		||||
            if(getConfigManager().getConfigMetrics().isAllowAnonymousUsageStatistics()) {
 | 
			
		||||
                Metrics metrics;
 | 
			
		||||
 | 
			
		||||
            if(MainConfig.getInstance().getIsMetricsEnabled()) {
 | 
			
		||||
                metrics = new Metrics(this);
 | 
			
		||||
                metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion()));
 | 
			
		||||
 | 
			
		||||
@@ -184,9 +180,6 @@ public class mcMMO extends JavaPlugin {
 | 
			
		||||
 | 
			
		||||
            getServer().getPluginManager().disablePlugin(this);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //Init the blacklist
 | 
			
		||||
        worldBlacklist = new WorldBlacklist();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -542,10 +535,6 @@ public class mcMMO extends JavaPlugin {
 | 
			
		||||
        return getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static WorldBlacklist getWorldBlacklist() {
 | 
			
		||||
        return worldBlacklist;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static ConfigManager getConfigManager() {
 | 
			
		||||
        return configManager;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user