SteamWar/FightSystem
Archiviert
13
1

Delay Team adding
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-03-11 20:43:47 +01:00
Ursprung b9e87de241
Commit 301a51bcd9
3 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -250,7 +250,7 @@ public class FightTeam {
players.put(player, fightPlayer); players.put(player, fightPlayer);
invited.remove(player); invited.remove(player);
Permanent.getSpectatorTeam().removeEntry(player.getName()); Permanent.getSpectatorTeam().removeEntry(player.getName());
team.addEntry(player.getName()); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> team.addEntry(player.getName()), 2);
Fight.setPlayerGamemode(player, GameMode.SURVIVAL); Fight.setPlayerGamemode(player, GameMode.SURVIVAL);
player.setHealth(20); player.setHealth(20);

Datei anzeigen

@ -28,6 +28,7 @@ import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentListener;
import de.steamwar.fightsystem.utils.FlatteningWrapper; import de.steamwar.fightsystem.utils.FlatteningWrapper;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -87,7 +88,7 @@ public class Permanent implements Listener {
if (!Config.ArenaLeaveable && !Fight.fighting(player)) { if (!Config.ArenaLeaveable && !Fight.fighting(player)) {
Fight.setPlayerGamemode(player, GameMode.SPECTATOR); Fight.setPlayerGamemode(player, GameMode.SPECTATOR);
spectatorTeam.addEntry(player.getName()); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> spectatorTeam.addEntry(player.getName()), 2);
player.teleport(Config.SpecSpawn); player.teleport(Config.SpecSpawn);
} }
} }

Datei anzeigen

@ -236,7 +236,7 @@ public class PacketProcessor implements Listener {
execSync(() -> { execSync(() -> {
SteamwarUser user = SteamwarUser.get(userId); SteamwarUser user = SteamwarUser.get(userId);
entities.put(entityId, new RPlayer(entityServer, user.getUUID(), user.getUserName(), Config.SpecSpawn)); entities.put(entityId, new RPlayer(entityServer, user.getUUID(), user.getUserName(), Config.SpecSpawn));
team.addEntry(user.getUserName()); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> team.addEntry(user.getUserName()), 2);
}); });
} }