SteamWar/FightSystem
Archiviert
13
1

Fix respawn own Schematic collision
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2024-01-25 11:24:22 +01:00
Ursprung 2469f1bced
Commit 75af1f00ba
2 geänderte Dateien mit 10 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -123,7 +123,7 @@ public class Fight {
if(!player.isOnline())
return;
pseudoSpectator(player, true);
}, 2);
}, 1);
}else if(gameMode == GameMode.SURVIVAL) {
for(Player currentPlayer : Bukkit.getServer().getOnlinePlayers()) {
if(currentPlayer.getUniqueId() != player.getUniqueId() && currentPlayer.getGameMode() == GameMode.SPECTATOR) {

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.events.BoardingEvent;
import de.steamwar.fightsystem.events.TeamDeathEvent;
import de.steamwar.fightsystem.events.TeamSpawnEvent;
@ -31,6 +32,7 @@ import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.OneShotStateDependent;
import de.steamwar.fightsystem.states.StateDependentListener;
import de.steamwar.fightsystem.states.StateDependentTask;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -114,8 +116,14 @@ public class TeamArea implements Listener {
fightPlayer.ifPlayer(player -> {
boolean inRegion = team.getExtendRegion().playerInRegion(player.getLocation());
if(inRegion && !realSpectator.contains(player)) {
Fight.pseudoSpectator(player, false);
realSpectator.add(player);
//Later to prevent race condition with Fight.setSpecatator() during respawn
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> {
if(!player.isOnline())
return;
Fight.pseudoSpectator(player, false);
}, 2);
}else if(!inRegion && realSpectator.contains(player)) {
Fight.pseudoSpectator(player, true);
realSpectator.remove(player);