join anytime #359
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Weiß nicht, ob es so geil ist, das Interface des geleavten Spielers immer noch herauszugeben.
Das ist zwingend notwendig für das korrekte Funktionieren des Kampfsystems und war auch bislang immer so, nur dass beim Rejoin des Spielers der dann halt nichts mehr mit dem alten Spieler zu tun hatte (was mit diesem PR dann allerdings katastrophal wäre).