mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-29 21:53:42 +01:00
Fix scoreboard flickering
This commit is contained in:
parent
7837c490cd
commit
1e74d196e9
@ -45,9 +45,8 @@ public class ScoreboardCommand extends SubCommand {
|
||||
} else {
|
||||
playerData.setScoreboard(true);
|
||||
scoreboardManager.removeDisabledPlayer(player);
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
scoreboardManager.updatePlayerScoreboardType(player);
|
||||
});
|
||||
Bukkit.getScheduler().runTask(plugin, () ->
|
||||
scoreboardManager.updatePlayerScoreboardType(player));
|
||||
|
||||
messageManager.sendMessage(player, configLoad.getString("Command.Scoreboard.Enabled.Message"));
|
||||
soundManager.playSound(player, CompatibleSound.BLOCK_WOODEN_DOOR_OPEN.getSound(), 1.0F, 1.0F);
|
||||
|
@ -98,10 +98,9 @@ public class ScoreboardManager extends Manager {
|
||||
|
||||
public void setPlayerScoreboard(Player player, ScoreboardType type) {
|
||||
for(Driver driver : drivers) {
|
||||
driver.unregisterHolder(player);
|
||||
if(driver.getBoardType().equals(type)) {
|
||||
driver.registerHolder(new Holder(plugin, driver, player));
|
||||
} else {
|
||||
driver.unregisterHolder(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -110,10 +109,12 @@ public class ScoreboardManager extends Manager {
|
||||
for(Driver driver : drivers) {
|
||||
driver.unregisterHolder(player);
|
||||
}
|
||||
player.setScoreboard(emptyScoreboard);
|
||||
}
|
||||
|
||||
public void addDisabledPlayer(Player player) {
|
||||
disabledPlayers.add(player);
|
||||
Bukkit.getScheduler().runTask(plugin, () -> this.unregisterPlayer(player));
|
||||
}
|
||||
|
||||
public void removeDisabledPlayer(Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user