2014-07-16 20:07:23 +02:00
|
|
|
package com.gmail.nossr50.api;
|
|
|
|
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
|
|
|
2014-07-16 20:07:23 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(Arrays.asList(PrimarySkillType.values()));
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(PrimarySkillType.NON_CHILD_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(PrimarySkillType.CHILD_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(PrimarySkillType.COMBAT_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(PrimarySkillType.GATHERING_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2019-01-13 08:54:53 +01:00
|
|
|
return getListFromEnum(PrimarySkillType.MISC_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
private static List<String> getListFromEnum(List<PrimarySkillType> skillsTypes) {
|
2020-07-13 21:31:30 +02:00
|
|
|
List<String> skills = new ArrayList<>();
|
2014-07-16 20:07:23 +02:00
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
for (PrimarySkillType primarySkillType : skillsTypes) {
|
|
|
|
skills.add(primarySkillType.name());
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return skills;
|
|
|
|
}
|
|
|
|
}
|