From e1a9af51b8ef70f27e0deb8223d641d02c46bf0b Mon Sep 17 00:00:00 2001 From: jojo Date: Sat, 30 Jan 2021 15:43:14 +0100 Subject: [PATCH] Hotfix Tablist colors --- src/de/steamwar/misslewars/listener/JoinListener.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/misslewars/listener/JoinListener.java b/src/de/steamwar/misslewars/listener/JoinListener.java index ecac885..a5e9a33 100644 --- a/src/de/steamwar/misslewars/listener/JoinListener.java +++ b/src/de/steamwar/misslewars/listener/JoinListener.java @@ -24,6 +24,7 @@ import de.steamwar.misslewars.Config; import de.steamwar.misslewars.FightState; import de.steamwar.misslewars.MissileWars; import de.steamwar.sql.SteamwarUser; +import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerJoinEvent; @@ -39,14 +40,17 @@ public class JoinListener extends BasicListener { @EventHandler(priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent e){ e.setJoinMessage("§a» " + e.getPlayer().getDisplayName()); - if (!Config.test()) - new TablistNamePacket(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), "§7" + e.getPlayer().getName()).send(e.getPlayer()); if (Config.isChallenge()) { if (Config.RedLeader.equals(e.getPlayer().getUniqueId())) { MissileWars.getRedTeam().join(e.getPlayer()); } else if (Config.BlueLeader.equals(e.getPlayer().getUniqueId())) { MissileWars.getBlueTeam().join(e.getPlayer()); } else { + if (!Config.test()) { + Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> { + new TablistNamePacket(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), "§7" + e.getPlayer().getName()).send(e.getPlayer()); + }, 5); + } MissileWars.spectateJoin(e.getPlayer()); } return;