diff --git a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java index c63cf5c7d..0d72b5333 100644 --- a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java +++ b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.api; import com.gmail.nossr50.api.exceptions.*; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.experience.XPGainReason; diff --git a/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java b/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java index ebfc92cf2..078a5cab6 100644 --- a/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/database/McpurgeCommand.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; diff --git a/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index 657a70a54..8a9c69052 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.commands.player; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.commands.CommandUtils; diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index 776eab286..6bd044947 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -3,9 +3,9 @@ package com.gmail.nossr50.config; import com.gmail.nossr50.config.collectionconfigs.RepairConfig; import com.gmail.nossr50.config.collectionconfigs.SalvageConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling; import com.gmail.nossr50.config.hocon.SerializedConfigLoader; import com.gmail.nossr50.config.hocon.database.ConfigDatabase; +import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling; import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard; import com.gmail.nossr50.config.party.ItemWeightConfig; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigDatabase.java b/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigDatabase.java index 67a236146..10c1678e6 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigDatabase.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigDatabase.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.database; -import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigSectionCleaning.java b/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigSectionCleaning.java index 271e24307..a5d729ee3 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigSectionCleaning.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/database/ConfigSectionCleaning.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.database; -import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigLeveling.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigLeveling.java index 583524184..66129e131 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigLeveling.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigLeveling.java @@ -7,36 +7,30 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigLeveling { - /* DEFAULT VALUES */ - private static final int STARTING_LEVEL_DEFAULT = 1; - /* * CONFIG NODES */ - @Setting(value = "Player-Starting-Level", - comment = "\nPlayers will start at this level in all skills if they aren't already saved in the database." + - "\nHistorically this number has been 0, but this was changed in 2.1.X to 1 as I felt it was better to start from 1 than 0." + - "\nDefault value: "+STARTING_LEVEL_DEFAULT) - private int startingLevel = STARTING_LEVEL_DEFAULT; - @Setting(value = "Player-Level-Caps", comment = "Restrict players from going above certain skill levels" + "\nPlayers that have skills above the limit will have their skill levels truncated down to the limit.") private ConfigSectionLevelCaps configSectionLevelCaps = new ConfigSectionLevelCaps(); + @Setting(value = "General", comment = "Settings for player leveling that don't fall into other categories") + private ConfigSectionLevelingGeneral configSectionLevelingGeneral = new ConfigSectionLevelingGeneral(); + /* * GETTER BOILERPLATE */ - public int getStartingLevel() { - return startingLevel; - } - public ConfigSectionLevelCaps getConfigSectionLevelCaps() { return configSectionLevelCaps; } + public ConfigSectionLevelingGeneral getConfigSectionLevelingGeneral() { + return configSectionLevelingGeneral; + } + /* * HELPER METHODS */ diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelCaps.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelCaps.java index 5b81827b0..93e73aa50 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelCaps.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelCaps.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.playerleveling; -import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelScaling.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelScaling.java new file mode 100644 index 000000000..87fa41f9e --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelScaling.java @@ -0,0 +1,30 @@ +package com.gmail.nossr50.config.hocon.playerleveling; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigSectionLevelScaling { + + /* DEFAULT VALUES */ + public static final boolean USE_RETRO_MODE_DEFAULT = false; + + /* + * CONFIG NODES + */ + + @Setting(value = "Use-Retro-Mode", + comment = "Enables 1-1000 Level Scaling" + + "\nIf set to false, Standard Scaling is used instead (1-100 Level Scaling)") + private boolean useRetroMode = USE_RETRO_MODE_DEFAULT; + + + + /* + * GETTER BOILERPLATE + */ + + public boolean isRetroModeEnabled() { + return useRetroMode; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelingGeneral.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelingGeneral.java new file mode 100644 index 000000000..e951f6878 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionLevelingGeneral.java @@ -0,0 +1,47 @@ +package com.gmail.nossr50.config.hocon.playerleveling; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigSectionLevelingGeneral { + + /* DEFAULT VALUES */ + private static final int STARTING_LEVEL_DEFAULT = 1; + + /* + * CONFIG NODES + */ + + @Setting(value = "Player-Level-Scaling", + comment = "Level Scaling is a new feature of mcMMO." + + "\nServer admins can choose between two level scaling modes." + + "\nEach mode is meant to be identical to each other in terms of the speed of progression." + + "\nIn Retro player skills and levels scale the way they always have, on a 1-1000 scale." + + "\nIn Standard player skills scale instead from 1-100." + + "\nAs an example, reaching level 10 in Standard will take the same amount of time as reaching level 100 in Retro" + + "\n\nTo make upgrading mcMMO easier for the vast majority of existing servers, RetroMode will be turned on by default in the following circumstances" + + "\n1) That your server has a config.yml file that does not yet have a RetroMode setting (this means your server has not yet updated from the old system which did not have two level scaling options)" + + "\n2) You are already using RetroMode in your old YAML config files" + + "\n\nIf either of these is true, RetroMode will be turned on by default. If for some reason you had wiped your config files, you will need to come in here and turn RetroMode back on." + + "\nNOTE: RetroMode and Standard use the EXACT same DB, it does not alter any information within that DB. It is not dangerous to switch between Standard and Retro.") + private ConfigSectionLevelScaling configSectionLevelScaling = new ConfigSectionLevelScaling(); + + @Setting(value = "Player-Starting-Level", + comment = "\nPlayers will start at this level in all skills if they aren't already saved in the database." + + "\nHistorically this number has been 0, but this was changed in 2.1.X to 1 as I felt it was better to start from 1 than 0." + + "\nDefault value: "+STARTING_LEVEL_DEFAULT) + private int startingLevel = STARTING_LEVEL_DEFAULT; + + /* + * GETTER BOILERPLATE + */ + + public int getStartingLevel() { + return startingLevel; + } + + public ConfigSectionLevelScaling getConfigSectionLevelScaling() { + return configSectionLevelScaling; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkillLevelCap.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkillLevelCap.java index c7e3bfe6f..91229a09b 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkillLevelCap.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkillLevelCap.java @@ -6,15 +6,27 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigSectionSkillLevelCap { + /* DEFAULT VALUES */ private static final boolean USE_LEVEL_CAP_DEFAULT = false; private static final int LEVEL_CAP_DEFAULT = 0; + /* + * CONFIG NODES + */ + @Setting(value = "Enable") private boolean useLevelCap = USE_LEVEL_CAP_DEFAULT; - @Setting(value = "Level-Cap", comment = "Players will be unable to level past this value") + @Setting(value = "Level-Cap", + comment = "Players will be unable to level past this value" + + "\nThe cap is the same for both Retro and Standard, " + + "so a cap of 50 will be the same value in either mode.") private int levelCap = LEVEL_CAP_DEFAULT; + /* + * GETTER BOILERPLATE + */ + public boolean isLevelCapEnabled() { return useLevelCap; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkills.java index 62f39cf71..ef304fb29 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigSectionSkills.java @@ -6,6 +6,10 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigSectionSkills { + /* + * CONFIG NODES + */ + @Setting(value = "Acrobatics") private ConfigSectionSkillLevelCap acrobatics = new ConfigSectionSkillLevelCap(); @@ -51,6 +55,10 @@ public class ConfigSectionSkills { @Setting(value = "Salvage") private ConfigSectionSkillLevelCap salvage = new ConfigSectionSkillLevelCap(); + /* + * GETTER BOILERPLATE + */ + public ConfigSectionSkillLevelCap getAcrobatics() { return acrobatics; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigScoreboard.java b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigScoreboard.java index d664c2e4f..4c1c6a32a 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigScoreboard.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigScoreboard.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.scoreboard; -import com.gmail.nossr50.config.ConfigConstants; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionScoreboardTypes.java b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionScoreboardTypes.java index f7e4cf04e..c03b898e8 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionScoreboardTypes.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionScoreboardTypes.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.scoreboard; -import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionSkillBoard.java b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionSkillBoard.java index 43c151b09..fd568fe85 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionSkillBoard.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/scoreboard/ConfigSectionSkillBoard.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.hocon.scoreboard; -import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/database/DatabaseManager.java b/src/main/java/com/gmail/nossr50/database/DatabaseManager.java index 1477eae2e..5c5653a63 100644 --- a/src/main/java/com/gmail/nossr50/database/DatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/DatabaseManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.database; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.datatypes.database.DatabaseType; import com.gmail.nossr50.datatypes.database.PlayerStat; import com.gmail.nossr50.datatypes.player.PlayerProfile; diff --git a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java index e7f3ea4e3..afa9fd986 100644 --- a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java @@ -57,7 +57,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { boolean powerless = true; for (int skill : skills.values()) { - if (skill > mcMMO.getPlayerLevelingSettings().getStartingLevel()) { + if (skill > mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel()) { powerless = false; break; } @@ -383,7 +383,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Open the file to write the player out = new BufferedWriter(new FileWriter(mcMMO.getUsersFilePath(), true)); - String startingLevel = mcMMO.getPlayerLevelingSettings().getStartingLevel() + ":"; + String startingLevel = mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel() + ":"; // Add the player to the end out.append(playerName).append(":"); diff --git a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java index 0660e1ae3..c8243d2c0 100644 --- a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java @@ -118,7 +118,7 @@ public final class SQLDatabaseManager implements DatabaseManager { connection = getConnection(PoolIdentifier.MISC); statement = connection.createStatement(); - String startingLevel = String.valueOf(mcMMO.getPlayerLevelingSettings().getStartingLevel()); + String startingLevel = String.valueOf(mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel()); //Purge users who have not leveled from the default level purged = statement.executeUpdate("DELETE FROM " + tablePrefix + "skills WHERE " @@ -855,8 +855,8 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setString(2, tablePrefix + "skills"); resultSet = statement.executeQuery(); if (!resultSet.next()) { - String startingLevel = "'" + mcMMO.getPlayerLevelingSettings().getStartingLevel() + "'"; - String totalLevel = "'" + (mcMMO.getPlayerLevelingSettings().getStartingLevel() * (PrimarySkillType.values().length - PrimarySkillType.CHILD_SKILLS.size())) + "'"; + String startingLevel = "'" + mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel() + "'"; + String totalLevel = "'" + (mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel() * (PrimarySkillType.values().length - PrimarySkillType.CHILD_SKILLS.size())) + "'"; createStatement = connection.createStatement(); createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "skills` (" + "`user_id` int(10) unsigned NOT NULL," diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index 504d828ef..4e8a3be26 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.datatypes.player; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.MobHealthbarType; @@ -57,7 +56,7 @@ public class PlayerProfile { } for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { - skills.put(primarySkillType, mcMMO.getPlayerLevelingSettings().getStartingLevel()); + skills.put(primarySkillType, mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel()); skillsXp.put(primarySkillType, 0F); } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 5af2906e7..4f1e30d18 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.config.CoreSkillsConfig; import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; -import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling; import com.gmail.nossr50.config.hocon.database.ConfigSectionCleaning; import com.gmail.nossr50.config.hocon.database.ConfigSectionMySQL; +import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling; import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard; import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManagerFactory; @@ -36,7 +36,6 @@ import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; import org.bukkit.entity.Player; @@ -47,8 +46,6 @@ import org.bukkit.plugin.java.JavaPlugin; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; public class mcMMO extends JavaPlugin { /* Managers */ @@ -80,8 +77,6 @@ public class mcMMO extends JavaPlugin { // XP Event Check private boolean xpEventEnabled; - private static boolean isRetroModeEnabled; - /* Metadata Values */ public static final String FISH_HOOK_REF_METAKEY = "mcMMO: Fish Hook Tracker"; public static final String CUSTOM_DAMAGE_METAKEY = "mcMMO: Custom Damage"; @@ -129,17 +124,6 @@ public class mcMMO extends JavaPlugin { loadConfigFiles(); - /*if (!noErrorsInConfigFiles) { - return; - }*/ - - //Store this value so other plugins can check it - isRetroModeEnabled = MainConfig.getInstance().getIsRetroMode(); - - /*if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) { - checkModConfigs(); - }*/ - if (healthBarPluginEnabled) { getLogger().info("HealthBar plugin found, mcMMO's healthbars are automatically disabled."); } @@ -186,7 +170,7 @@ public class mcMMO extends JavaPlugin { metrics = new Metrics(this); metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion())); - if(MainConfig.getInstance().getIsRetroMode()) + if(!configManager.getConfigLeveling().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled()) metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Standard")); else metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Retro")); @@ -548,11 +532,6 @@ public class mcMMO extends JavaPlugin { } }*/ - public InputStreamReader getResourceAsReader(String fileName) { - InputStream in = getResource(fileName); - return in == null ? null : new InputStreamReader(in, Charsets.UTF_8); - } - /** * Checks if this plugin is using retro mode * Retro mode is a 0-1000 skill system @@ -560,7 +539,7 @@ public class mcMMO extends JavaPlugin { * @return true if retro mode is enabled */ public static boolean isRetroModeEnabled() { - return isRetroModeEnabled; + return getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled(); } public static WorldBlacklist getWorldBlacklist() { diff --git a/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java b/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java index f8b9ecee3..baf5574c5 100644 --- a/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/database/UserPurgeTask.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.runnables.database; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.mcMMO; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index c7c53667d..2fb04c365 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -15,7 +15,6 @@ import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.commands.player.*; import com.gmail.nossr50.commands.skills.*; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; diff --git a/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java b/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java index 8de0827b0..ccccfe813 100644 --- a/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java +++ b/src/main/java/com/gmail/nossr50/util/experience/FormulaManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.util.experience; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; @@ -25,7 +24,7 @@ public class FormulaManager { public FormulaManager() { /* Setting for Classic Mode (Scales a lot of stuff up by * 10) */ - retroModeEnabled = MainConfig.getInstance().getIsRetroMode(); + retroModeEnabled = mcMMO.isRetroModeEnabled(); loadFormula(); } @@ -91,7 +90,7 @@ public class FormulaManager { break; //If the maximum level is at or below our starting level, then the player can't level up anymore - if(maxLevel <= mcMMO.getPlayerLevelingSettings().getStartingLevel()) + if(maxLevel <= mcMMO.getPlayerLevelingSettings().getConfigSectionLevelingGeneral().getStartingLevel()) return new int[]{ newLevel, remainder }; }