mcMMO/src/main/java/com/gmail/nossr50/api/SkillAPI.java

94 lines
2.6 KiB
Java
Raw Normal View History

package com.gmail.nossr50.api;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
2018-12-29 14:24:55 +01:00
import com.gmail.nossr50.datatypes.skills.PrimarySkill;
public final class SkillAPI {
private SkillAPI() {}
/**
* Returns a list of strings with mcMMO's skills
* This includes parent and child skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(Arrays.asList(PrimarySkill.values()));
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes parent skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getNonChildSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(PrimarySkill.NON_CHILD_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes child skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getChildSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(PrimarySkill.CHILD_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes combat skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getCombatSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(PrimarySkill.COMBAT_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes gathering skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getGatheringSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(PrimarySkill.GATHERING_SKILLS);
}
/**
* Returns a list of strings with mcMMO's skills
* This only includes misc skills
* </br>
* This function is designed for API usage.
*
* @return a list of strings with valid skill names
*/
public static List<String> getMiscSkills() {
2018-12-29 14:24:55 +01:00
return getListFromEnum(PrimarySkill.MISC_SKILLS);
}
2018-12-29 14:24:55 +01:00
private static List<String> getListFromEnum(List<PrimarySkill> skillsTypes) {
List<String> skills = new ArrayList<String>();
2018-12-29 14:24:55 +01:00
for (PrimarySkill primarySkill : skillsTypes) {
skills.add(primarySkill.name());
}
return skills;
}
}