mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
We don't need two functions that do the exact same thing.
This commit is contained in:
@ -269,22 +269,6 @@ public class SkillTools {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the skill represented by the given string
|
||||
*
|
||||
* @param skillName The name of the skill
|
||||
* @return the SkillType if it exists, null otherwise
|
||||
*/
|
||||
public static SkillType getSkillType(String skillName) {
|
||||
for (SkillType x : SkillType.values()) {
|
||||
if (x.toString().equalsIgnoreCase(skillName)) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string represents a valid skill
|
||||
*
|
||||
@ -292,7 +276,7 @@ public class SkillTools {
|
||||
* @return true if this is a valid skill, false otherwise
|
||||
*/
|
||||
public static boolean isSkill(String skillName) {
|
||||
if (getSkillType(skillName) != null) {
|
||||
if (SkillType.getSkill(skillName) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public enum SkillType {
|
||||
}
|
||||
|
||||
public static SkillType getSkill(String skillName) {
|
||||
for (SkillType type : SkillType.values()) {
|
||||
for (SkillType type : values()) {
|
||||
if (type.name().equalsIgnoreCase(skillName)) {
|
||||
return type;
|
||||
}
|
||||
|
Reference in New Issue
Block a user