mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 09:06:46 +01:00
Useless else statements.
This commit is contained in:
parent
9512879cc7
commit
900623461a
@ -119,17 +119,19 @@ 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;
|
|
||||||
}
|
}
|
||||||
System.out.println("[DEBUG] Invalid mcMMO skill ("+skillName+")");
|
|
||||||
|
for (SkillType type : SkillType.values()) {
|
||||||
|
if (type.name().equalsIgnoreCase(skillName)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
|
@ -211,20 +211,19 @@ public class Leaderboard {
|
|||||||
int currentPos = 1;
|
int currentPos = 1;
|
||||||
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