mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Useless else statements.
This commit is contained in:
parent
9512879cc7
commit
900623461a
@ -121,15 +121,17 @@ public enum SkillType {
|
|||||||
public static SkillType getSkill(String skillName) {
|
public static SkillType getSkill(String skillName) {
|
||||||
if (skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("all")) {
|
if (skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("all")) {
|
||||||
return SkillType.ALL;
|
return SkillType.ALL;
|
||||||
} else {
|
|
||||||
for(SkillType st : SkillType.values()) {
|
|
||||||
if(st.name().equalsIgnoreCase(skillName))
|
|
||||||
return st;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (SkillType type : SkillType.values()) {
|
||||||
|
if (type.name().equalsIgnoreCase(skillName)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("[DEBUG] Invalid mcMMO skill (" + skillName + ")");
|
System.out.println("[DEBUG] Invalid mcMMO skill (" + skillName + ")");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the skill level for this skill.
|
* Get the skill level for this skill.
|
||||||
|
@ -212,19 +212,18 @@ public class Leaderboard {
|
|||||||
List<PlayerStat> statsList = playerStatHash.get(skillType);
|
List<PlayerStat> statsList = playerStatHash.get(skillType);
|
||||||
|
|
||||||
if (statsList != null) {
|
if (statsList != null) {
|
||||||
for(PlayerStat ps : statsList) {
|
for (PlayerStat stat : statsList) {
|
||||||
if(ps.name.equalsIgnoreCase(playerName)) {
|
if (stat.name.equalsIgnoreCase(playerName)) {
|
||||||
return new int[] {currentPos, ps.statVal};
|
return new int[] {currentPos, stat.statVal};
|
||||||
} else {
|
}
|
||||||
|
|
||||||
currentPos++;
|
currentPos++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
return new int[] {0};
|
||||||
}
|
}
|
||||||
|
|
||||||
return new int[] {0};
|
return new int[] {0};
|
||||||
} else {
|
|
||||||
return new int[] {0};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class SkillComparator implements Comparator<PlayerStat> {
|
private static class SkillComparator implements Comparator<PlayerStat> {
|
||||||
|
Loading…
Reference in New Issue
Block a user