mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-26 20:26:34 +01:00
Reverted Scoreboard to a sync state
This commit is contained in:
parent
4400ac4297
commit
2b99f411c3
@ -39,10 +39,11 @@ public class ScoreboardManager {
|
||||
this.plugin = plugin;
|
||||
this.playerDataManager = plugin.getPlayerDataManager();
|
||||
Bukkit.getScheduler().runTask(plugin, () -> reloadScoreboards(true));
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, this::updateScoreboards, 20L, 40L);
|
||||
Bukkit.getScheduler().runTaskTimer(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();
|
||||
@ -76,6 +77,7 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
/*
|
||||
* Update the objective/team names.
|
||||
*/
|
||||
@ -95,6 +97,7 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
/*
|
||||
* Update or add any missing information to the player's scoreboard.
|
||||
*/
|
||||
@ -145,6 +148,9 @@ public class ScoreboardManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public synchronized void reloadScoreboards(boolean createNew) {
|
||||
|
Loading…
Reference in New Issue
Block a user