From 5dbe85db6fa3f81ec1f6ddc52dc4b7e8cc5ddec4 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 14 Jun 2022 09:04:08 +0200 Subject: [PATCH] Fix FightSystem Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/utils/FightStatistics.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java index 52a2a26..fa61303 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java @@ -19,7 +19,6 @@ package de.steamwar.fightsystem.utils; -import de.steamwar.comms.packets.FightEndsPacket; import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.FightSystem; @@ -31,10 +30,11 @@ import de.steamwar.fightsystem.record.FileRecorder; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.OneShotStateDependent; import de.steamwar.fightsystem.winconditions.Wincondition; +import de.steamwar.network.NetworkSender; +import de.steamwar.network.packets.common.FightEndsPacket; import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; -import org.bukkit.entity.Player; import java.io.FileInputStream; import java.sql.Timestamp; @@ -132,8 +132,7 @@ public class FightStatistics { } if (!Bukkit.getOnlinePlayers().isEmpty() && !unranked) { - Player p = Bukkit.getOnlinePlayers().iterator().next(); - new FightEndsPacket((byte) win, blueSchem == null ? 0 : blueSchem, redSchem == null ? 0 : redSchem, Fight.getBlueTeam().getPlayers().stream().map(FightPlayer::getPlayer).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()), Fight.getRedTeam().getPlayers().stream().map(FightPlayer::getPlayer).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()), gameMode).send(p); + NetworkSender.send(new FightEndsPacket((byte) win, blueSchem == null ? 0 : blueSchem, redSchem == null ? 0 : redSchem, Fight.getBlueTeam().getPlayers().stream().map(FightPlayer::getPlayer).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()), Fight.getRedTeam().getPlayers().stream().map(FightPlayer::getPlayer).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()), gameMode)); } unranked = false;