diff --git a/src/main/java/com/gmail/nossr50/api/SkillAPI.java b/src/main/java/com/gmail/nossr50/api/SkillAPI.java index d6341ab9a..58a1c7da4 100644 --- a/src/main/java/com/gmail/nossr50/api/SkillAPI.java +++ b/src/main/java/com/gmail/nossr50/api/SkillAPI.java @@ -17,7 +17,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getSkills() { - return SkillType.skillNames; + return SkillType.getSkillNames(); } /** @@ -29,7 +29,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getNonChildSkills() { - return getStringListFromSkillList(SkillType.nonChildSkills); + return getStringListFromSkillList(SkillType.getNonChildSkills()); } /** @@ -41,7 +41,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getChildSkills() { - return getStringListFromSkillList(SkillType.childSkills); + return getStringListFromSkillList(SkillType.getChildSkills()); } /** @@ -53,7 +53,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getCombatSkills() { - return getStringListFromSkillList(SkillType.combatSkills); + return getStringListFromSkillList(SkillType.getCombatSkills()); } /** @@ -65,7 +65,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getGatheringSkills() { - return getStringListFromSkillList(SkillType.gatheringSkills); + return getStringListFromSkillList(SkillType.getGatheringSkills()); } /** @@ -77,7 +77,7 @@ public final class SkillAPI { * @return a list of strings with valid skill names */ public static List getMiscSkills() { - return getStringListFromSkillList(SkillType.miscSkills); + return getStringListFromSkillList(SkillType.getMiscSkills()); } private static List getStringListFromSkillList(List skillsTypes) { diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/SkillType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/SkillType.java index f2324c878..819dcd8be 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SkillType.java @@ -101,25 +101,25 @@ public class SkillType { public static SkillType createSkill(String name, Class managerClass, Class commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, AbilityType ability, ToolType tool, List secondaryAbilities) { SkillType skill = new SkillType(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ability, tool, secondaryAbilities); - skillList.add(skill); + getSkillList().add(skill); if(skill.isChild) { - childSkills.add(skill); + getChildSkills().add(skill); } else { - nonChildSkills.add(skill); + getNonChildSkills().add(skill); } switch(skill.skillUseType) { case COMBAT: - combatSkills.add(skill); + getCombatSkills().add(skill); break; case GATHERING: - gatheringSkills.add(skill); + getGatheringSkills().add(skill); break; default: - miscSkills.add(skill); + getMiscSkills().add(skill); break; } - skillNames.add(skill.name); + getSkillNames().add(skill.name); return skill; } @@ -202,7 +202,7 @@ public class SkillType { public static SkillType getSkillFromLocalized(String skillName) { if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { - for (SkillType type : skillList) { + for (SkillType type : getSkillList()) { if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name) + ".SkillName"))) { return type; } @@ -213,7 +213,7 @@ public class SkillType { } public static SkillType getSkill(String skillName) { - for (SkillType type : skillList) { + for (SkillType type : getSkillList()) { if (type.name.equalsIgnoreCase(skillName)) { return type; } @@ -231,7 +231,7 @@ public class SkillType { } public static SkillType bySecondaryAbility(SecondaryAbility skillAbility) { - for (SkillType type : skillList) { + for (SkillType type : getSkillList()) { if (type.getSkillAbilities().contains(skillAbility)) { return type; } @@ -240,7 +240,7 @@ public class SkillType { } public static SkillType byAbility(AbilityType ability) { - for (SkillType type : skillList) { + for (SkillType type : getSkillList()) { if (type.getAbility() == ability) { return type; } @@ -278,6 +278,34 @@ public class SkillType { public static void setUpSkillTypes() { - Collections.sort(skillNames); + Collections.sort(getSkillNames()); } + + public static List getSkillNames() { + return skillNames; + } + + public static List getSkillList() { + return skillList; + } + + public static List getChildSkills() { + return childSkills; + } + + public static List getNonChildSkills() { + return nonChildSkills; + } + + public static List getCombatSkills() { + return combatSkills; + } + + public static List getGatheringSkills() { + return gatheringSkills; + } + + public static List getMiscSkills() { + return miscSkills; + } }