simplification
This commit is contained in:
@@ -11,12 +11,12 @@ public class Prestiges extends RankList<Prestige> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Prestige getByPlayer(Player player) {
|
||||
Prestige prestige = super.getByPlayer(player);
|
||||
if (prestige == null) {
|
||||
return getFirst();
|
||||
} else {
|
||||
return prestige;
|
||||
public Prestige getFirst() {
|
||||
for (Prestige prestige : ranks) {
|
||||
if (prestige.getRank() == null) {
|
||||
return prestige;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("No prestige found for first prestige (first prestige is counted as a prestige without a rank set)");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user