SteamWar/MissileWars
Archiviert
13
0

Hotfix Tablist colors

Dieser Commit ist enthalten in:
jojo 2021-01-30 15:43:14 +01:00
Ursprung 83b1f9c6fc
Commit e1a9af51b8

Datei anzeigen

@ -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;