Remove the old rank config file

This commit is contained in:
nossr50 2019-06-04 13:13:41 -07:00
parent cf6a4c804a
commit b2dc322a2b
4 changed files with 0 additions and 91 deletions

View File

@ -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();
}

View File

@ -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<String> validateKeys() {
List<String> 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<String> 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");
}
}
}
}
}

View File

@ -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;

View File

@ -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;