From b9a71df5b7feecd75cac4c3731f565dac497f444 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 14 Jun 2022 14:15:15 +0200 Subject: [PATCH] Fix MW --- src/de/steamwar/misslewars/FightInfoPacketSender.java | 9 +++------ src/de/steamwar/misslewars/MWTeam.java | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/misslewars/FightInfoPacketSender.java b/src/de/steamwar/misslewars/FightInfoPacketSender.java index e1cc71d..6a69236 100644 --- a/src/de/steamwar/misslewars/FightInfoPacketSender.java +++ b/src/de/steamwar/misslewars/FightInfoPacketSender.java @@ -21,7 +21,8 @@ package de.steamwar.misslewars; -import de.steamwar.comms.packets.FightInfoPacket; +import de.steamwar.network.NetworkSender; +import de.steamwar.network.packets.common.FightInfoPacket; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; import org.bukkit.World; @@ -43,9 +44,6 @@ public class FightInfoPacketSender implements Runnable { @Override public void run() { - if (Bukkit.getOnlinePlayers().isEmpty()) { - return; - } if (Config.test()) { return; } @@ -68,7 +66,6 @@ public class FightInfoPacketSender implements Runnable { .filter(integer -> !(bluePlayers.contains(integer) || redPlayers.contains(integer))) .collect(Collectors.toList()); - new FightInfoPacket(serverName, gameMode, worldName, blueName, redName, MissileWars.getFightState().name().toLowerCase(), countdown, blueLeader, redLeader, 0, 0, bluePlayers, redPlayers, spectatorPlayers) - .send(Bukkit.getOnlinePlayers().iterator().next()); + NetworkSender.send(new FightInfoPacket(serverName, gameMode, worldName, blueName, redName, MissileWars.getFightState().name().toLowerCase(), countdown, blueLeader, redLeader, 0, 0, bluePlayers, redPlayers, spectatorPlayers)); } } diff --git a/src/de/steamwar/misslewars/MWTeam.java b/src/de/steamwar/misslewars/MWTeam.java index cf59dea..5078681 100644 --- a/src/de/steamwar/misslewars/MWTeam.java +++ b/src/de/steamwar/misslewars/MWTeam.java @@ -19,9 +19,6 @@ package de.steamwar.misslewars; -import de.steamwar.comms.packets.FightInfoPacket; -import de.steamwar.comms.packets.TablistNamePacket; -import de.steamwar.sql.SteamwarUser; import org.bukkit.*; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player;