join anytime #359
@ -76,7 +76,7 @@ public class FightPlayer {
|
|||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
Player bukkit = Bukkit.getPlayer(uuid);
|
Player bukkit = Bukkit.getPlayer(uuid);
|
||||||
if(bukkit != player)
|
if(bukkit != null)
|
||||||
player = bukkit;
|
player = bukkit;
|
||||||
return player;
|
return player;
|
||||||
|
|||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ public class FightTeam {
|
|||||||
Set<UUID> playerSet = new HashSet<>(players.keySet());
|
Set<UUID> playerSet = new HashSet<>(players.keySet());
|
||||||
for(UUID uuid : playerSet){
|
for(UUID uuid : playerSet){
|
||||||
Player player = Bukkit.getPlayer(uuid);
|
Player player = Bukkit.getPlayer(uuid);
|
||||||
if(player != null)
|
if(player == null)
|
||||||
removePlayer(player);
|
removePlayer(player);
|
||||||
}
|
}
|
||||||
FightPlayer leaderBackup = leader;
|
FightPlayer leaderBackup = leader;
|
||||||
|
@ -95,11 +95,16 @@ public class Permanent implements Listener {
|
|||||||
event.setJoinMessage(null);
|
event.setJoinMessage(null);
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
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);
|
Fight.setPlayerGamemode(player, GameMode.SPECTATOR);
|
||||||
spectatorTeam.addEntry(player.getName());
|
spectatorTeam.addEntry(player.getName());
|
||||||
player.teleport(Config.SpecSpawn);
|
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).