SteamWar/FightSystem
Archiviert
13
1

Bugfixes: Offline players, rejoining
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-06-06 18:44:17 +02:00
Ursprung 6081c5f565
Commit 43e63b4201
3 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -76,7 +76,7 @@ public class FightPlayer {
public Player getPlayer() {
Player bukkit = Bukkit.getPlayer(uuid);
if(bukkit != player)
if(bukkit != null)
player = bukkit;
return player;
}

Datei anzeigen

@ -203,7 +203,7 @@ public class FightTeam {
Set<UUID> playerSet = new HashSet<>(players.keySet());
for(UUID uuid : playerSet){
Player player = Bukkit.getPlayer(uuid);
if(player != null)
if(player == null)
removePlayer(player);
}
FightPlayer leaderBackup = leader;

Datei anzeigen

@ -95,11 +95,16 @@ public class Permanent implements Listener {
event.setJoinMessage(null);
Player player = event.getPlayer();
FightPlayer fp = Fight.getFightPlayer(player);
if (!Config.ArenaLeaveable && !Fight.fighting(player)) {
if (!Config.ArenaLeaveable && fp == null) {
Fight.setPlayerGamemode(player, GameMode.SPECTATOR);
spectatorTeam.addEntry(player.getName());
player.teleport(Config.SpecSpawn);
} else if(fp != null && !fp.isLiving()) {
Fight.setPlayerGamemode(player, GameMode.SPECTATOR);
HotbarKit.spectatorKit.loadToPlayer(player);
player.teleport(fp.getTeam().getSpawn());
}
}