mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-27 09:51:36 +01:00
Edit sync-async scoreboard
This commit is contained in:
parent
80cc409899
commit
4452fa33fc
@ -37,7 +37,7 @@ public class ScoreboardManager {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.playerDataManager = plugin.getPlayerDataManager();
|
this.playerDataManager = plugin.getPlayerDataManager();
|
||||||
Bukkit.getScheduler().runTask(plugin, () -> reloadScoreboards(true));
|
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() {
|
private synchronized void updateScoreboards() {
|
||||||
@ -45,6 +45,7 @@ public class ScoreboardManager {
|
|||||||
final Set<Objective> objectives = primary.getObjectives();
|
final Set<Objective> objectives = primary.getObjectives();
|
||||||
final Set<Team> teams = primary.getTeams();
|
final Set<Team> teams = primary.getTeams();
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
/*
|
/*
|
||||||
* Unregister all teams or objectives that are no longer present in the main
|
* Unregister all teams or objectives that are no longer present in the main
|
||||||
* scoreboard.
|
* scoreboard.
|
||||||
@ -143,6 +144,7 @@ public class ScoreboardManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void reloadScoreboards(boolean createNew) {
|
public synchronized void reloadScoreboards(boolean createNew) {
|
||||||
|
Loading…
Reference in New Issue
Block a user