Useless else statements.

This commit is contained in:
GJ 2013-01-21 17:15:53 -05:00
parent 9512879cc7
commit 900623461a
2 changed files with 49 additions and 48 deletions

View File

@ -121,15 +121,17 @@ public enum SkillType {
public static SkillType getSkill(String skillName) {
if (skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("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 + ")");
return null;
}
}
/**
* Get the skill level for this skill.

View File

@ -212,19 +212,18 @@ public class Leaderboard {
List<PlayerStat> statsList = playerStatHash.get(skillType);
if (statsList != null) {
for(PlayerStat ps : statsList) {
if(ps.name.equalsIgnoreCase(playerName)) {
return new int[] {currentPos, ps.statVal};
} else {
for (PlayerStat stat : statsList) {
if (stat.name.equalsIgnoreCase(playerName)) {
return new int[] {currentPos, stat.statVal};
}
currentPos++;
continue;
}
return new int[] {0};
}
return new int[] {0};
} else {
return new int[] {0};
}
}
private static class SkillComparator implements Comparator<PlayerStat> {