Update scoreboard type on scoreboard enable

This commit is contained in:
Fabrizio La Rosa 2020-08-05 16:20:41 +02:00
parent 5542ff42dc
commit 7837c490cd

View File

@ -8,6 +8,7 @@ import com.songoda.skyblock.playerdata.PlayerData;
import com.songoda.skyblock.playerdata.PlayerDataManager;
import com.songoda.skyblock.scoreboard.ScoreboardManager;
import com.songoda.skyblock.sound.SoundManager;
import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
@ -44,6 +45,9 @@ public class ScoreboardCommand extends SubCommand {
} else {
playerData.setScoreboard(true);
scoreboardManager.removeDisabledPlayer(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);