Skip to content

Commit

Permalink
feat(board): change iterator for all boards
Browse files Browse the repository at this point in the history
  • Loading branch information
jonakls committed Apr 17, 2023
1 parent 67e1d3b commit 1616081
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
public class ScoreboardManager {

private final SternalBoardPlugin plugin;
private final Map<UUID, SternalBoardHandler> boardHandlerMap = new ConcurrentHashMap<>();
private final Map<UUID, SternalBoardHandler> boardHandlerMap;
private Integer updateTask;

public ScoreboardManager(SternalBoardPlugin plugin) {
this.plugin = plugin;
this.boardHandlerMap = new ConcurrentHashMap<>();
}

public Map<UUID, SternalBoardHandler> getBoardsHandler() {
Expand Down Expand Up @@ -51,20 +52,20 @@ public void init() {
ConfigurationSection defaultSection = plugin.getConfig()
.getConfigurationSection("settings.scoreboard");

for (SternalBoardHandler board : boardHandlerMap.values()) {
boardHandlerMap.forEach((context, handler) -> {
switch (scoreboardMode) {
case "WORLD":
processWorldScoreboard(board, defaultSection);
return;
processWorldScoreboard(handler, defaultSection);
break;
case "PERMISSION":
processPermissionScoreboard(board, defaultSection);
return;
processPermissionScoreboard(handler, defaultSection);
break;
case "NORMAL":
default:
Scoreboards.updateFromSection(plugin, board, defaultSection);
return;
Scoreboards.updateFromSection(plugin, handler, defaultSection);
break;
}
}
});
}, 0, updateTime).getTaskId();
}

Expand Down

0 comments on commit 1616081

Please sign in to comment.