From b2dc322a2bcdf4424362a26c29d6b5366cc71234 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 4 Jun 2019 13:13:41 -0700 Subject: [PATCH] Remove the old rank config file --- .../gmail/nossr50/config/ConfigManager.java | 5 -- .../com/gmail/nossr50/config/RankConfig.java | 84 ------------------- .../nossr50/util/TextComponentFactory.java | 1 - .../gmail/nossr50/util/skills/RankUtils.java | 1 - 4 files changed, 91 deletions(-) delete mode 100644 src/main/java/com/gmail/nossr50/config/RankConfig.java diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index 0155d29fd..27576a86e 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -133,7 +133,6 @@ public final class ConfigManager { private HerbalismTreasureConfig herbalismTreasureConfig; private AdvancedConfig advancedConfig; private SoundConfig soundConfig; - private RankConfig rankConfig; /* CONFIG ERRORS */ @@ -347,10 +346,6 @@ public final class ConfigManager { return soundConfig; } - public RankConfig getRankConfig() { - return rankConfig; - } - public ConfigDatabase getConfigDatabase() { return configDatabase.getConfig(); } diff --git a/src/main/java/com/gmail/nossr50/config/RankConfig.java b/src/main/java/com/gmail/nossr50/config/RankConfig.java deleted file mode 100644 index f88241256..000000000 --- a/src/main/java/com/gmail/nossr50/config/RankConfig.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.gmail.nossr50.config; - -import com.gmail.nossr50.config.hocon.skills.ranks.SkillRankProperty; -import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.mcMMO; -import ninja.leaping.configurate.commented.CommentedConfigurationNode; -import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; - -import java.util.ArrayList; -import java.util.List; - -@ConfigSerializable -public class RankConfig extends ConfigValidated { - - //private static RankConfig instance; - - public RankConfig() { - //super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml", true); - super("skillranks", mcMMO.p.getDataFolder().getAbsoluteFile(), ConfigConstants.RELATIVE_PATH_CONFIG_DIR, true, true, true, true); - //this.instance = this; - } - - /** - * This grabs an instance of this config class from the Config Manager - * This method is deprecated and will be removed in the future - * - * @return the instance of this config - * @see mcMMO#getConfigManager() - * @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead - */ - @Deprecated - public static RankConfig getInstance() { - return mcMMO.getConfigManager().getRankConfig(); - } - - /** - * The version of this config - * - * @return - */ - @Override - public double getConfigVersion() { - return 1; - } - - @Override - public List validateKeys() { - List reason = new ArrayList<>(); - - /* - * In the future this method will check keys for all skills, but for now it only checks overhauled skills - */ - checkKeys(reason); - - return reason; - } - - - - /** - * Checks for valid keys for subskill ranks - */ - private void checkKeys(List reasons) { - //For now we will only check ranks of stuff I've overhauled - for (SubSkillType subSkillType : SubSkillType.values()) { - //Keeping track of the rank requirements and making sure there are no logical errors - int curRank = 0; - int prevRank = 0; - - for (int x = 0; x < subSkillType.getNumRanks(); x++) { - if (curRank > 0) - prevRank = curRank; - - curRank = getSubSkillUnlockLevel(subSkillType, x); - - if (prevRank > curRank) { - //We're going to allow this but we're going to warn them - mcMMO.p.getLogger().severe("You have the ranks for the subskill " + subSkillType.toString() + " in skillranks config set up poorly, sequential ranks should have ascending requirements"); - } - } - } - } -} diff --git a/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java b/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java index b78ff6f8c..f57fbc12d 100644 --- a/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java +++ b/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.util; -import com.gmail.nossr50.config.RankConfig; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.json.McMMOUrl; import com.gmail.nossr50.datatypes.json.McMMOWebLinks; diff --git a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java index a113f2927..75dc9e593 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.util.skills; import com.gmail.nossr50.api.exceptions.MissingSkillPropertyDefinition; -import com.gmail.nossr50.config.RankConfig; import com.gmail.nossr50.config.hocon.skills.ranks.SkillRankProperty; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;