mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-10 09:47:42 +01:00
Redo async scoreboards
This commit is contained in:
parent
74eae7037a
commit
80cc409899
@ -37,11 +37,10 @@ public class ScoreboardManager {
|
||||
this.plugin = plugin;
|
||||
this.playerDataManager = plugin.getPlayerDataManager();
|
||||
Bukkit.getScheduler().runTask(plugin, () -> reloadScoreboards(true));
|
||||
Bukkit.getScheduler().runTaskTimer(plugin, this::updateScoreboards, 20L, 40L);
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, this::updateScoreboards, 20L, 40L);
|
||||
}
|
||||
|
||||
private synchronized void updateScoreboards() {
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
final org.bukkit.scoreboard.Scoreboard primary = Bukkit.getScoreboardManager().getMainScoreboard();
|
||||
final Set<Objective> objectives = primary.getObjectives();
|
||||
final Set<Team> teams = primary.getTeams();
|
||||
@ -75,7 +74,6 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
/*
|
||||
* Update the objective/team names.
|
||||
*/
|
||||
@ -95,7 +93,6 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
/*
|
||||
* Update or add any missing information to the player's scoreboard.
|
||||
*/
|
||||
@ -146,9 +143,6 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public synchronized void reloadScoreboards(boolean createNew) {
|
||||
|
Loading…
Reference in New Issue
Block a user