Skip to content

Commit d68a64d

Browse files
committed
レベリングシステム修正
1 parent 1db3733 commit d68a64d

File tree

1 file changed

+5
-10
lines changed
  • src/main/java/com/github/elic0de/thejpspit/spigot/leveler

1 file changed

+5
-10
lines changed

src/main/java/com/github/elic0de/thejpspit/spigot/leveler/Levels.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,13 @@ private static void initialize(String... texts) {
3333

3434
// TODO
3535
Level level = LEVELS.get(0);
36-
for (int i = 0; i < LEVELS.get(LEVELS.size() - 1).getLevel() + 10; i++) {
37-
if (level == null) {
38-
continue;
39-
}
40-
if (LEVELS.get(level.nextLevel()) != null) {
41-
continue;
42-
}
43-
final int nextLevel = level.nextLevel();
36+
for (int i = 1; i < LEVELS.get(LEVELS.size() - 1).getLevel() + 10; i++) {
4437
final int neededXp = level.getNeededXP();
38+
final ChatColor color = level.getLevelColor();
4539

46-
LEVELS.add(new Level(nextLevel, neededXp));
47-
level = LEVELS.get(nextLevel);
40+
if (LEVELS.get(i) != null) {
41+
level = LEVELS.get(i);
42+
} else LEVELS.add(new Level(i, neededXp, color));
4843
}
4944
}
5045

0 commit comments

Comments
 (0)