From 98cd6f5b259e0560254bf98dc1e9842919808008 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 11 Mar 2023 21:46:33 +0100 Subject: [PATCH] Remove delay Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/fight/FightTeam.java | 2 +- .../src/de/steamwar/fightsystem/listener/Permanent.java | 3 +-- .../src/de/steamwar/fightsystem/record/PacketProcessor.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java index c870054..dac4135 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -250,7 +250,7 @@ public class FightTeam { players.put(player, fightPlayer); invited.remove(player); Permanent.getSpectatorTeam().removeEntry(player.getName()); - Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> team.addEntry(player.getName()), 2); + team.addEntry(player.getName()); Fight.setPlayerGamemode(player, GameMode.SURVIVAL); player.setHealth(20); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index a9e961d..6e60e48 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -29,7 +29,6 @@ import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.utils.BountifulWrapper; import de.steamwar.fightsystem.utils.FlatteningWrapper; import net.md_5.bungee.api.ChatMessageType; -import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; @@ -95,7 +94,7 @@ public class Permanent implements Listener { if (!Config.ArenaLeaveable && !Fight.fighting(player)) { Fight.setPlayerGamemode(player, GameMode.SPECTATOR); - Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> spectatorTeam.addEntry(player.getName()), 2); + spectatorTeam.addEntry(player.getName()); player.teleport(Config.SpecSpawn); } } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java b/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java index c26b0c9..d7c31fd 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java @@ -236,7 +236,7 @@ public class PacketProcessor implements Listener { execSync(() -> { SteamwarUser user = SteamwarUser.get(userId); entities.put(entityId, new RPlayer(entityServer, user.getUUID(), user.getUserName(), Config.SpecSpawn)); - Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> team.addEntry(user.getUserName()), 2); + team.addEntry(user.getUserName()); }); }