diff --git a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java index 9e58dcc..4f0f2c3 100644 --- a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java +++ b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java @@ -31,6 +31,7 @@ import java.time.Instant; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; public class FightEndsHandler implements SpigotHandler { @@ -38,6 +39,7 @@ public class FightEndsHandler implements SpigotHandler { private int K = 20; private long defaultFightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */; private Map fightRanges = new HashMap<>(); + { fightRanges.put("miniwargear", 1000 /* Milliseconds */ * 60 /* Seconds */ * 10L /* Minutes */); } @@ -73,6 +75,13 @@ public class FightEndsHandler implements SpigotHandler { blueResult = 0; } + Set teamsIds = fightEndsPacket.getBluePlayers().stream().map(SteamwarUser::get).map(SteamwarUser::getTeam).collect(Collectors.toSet()); + for (int redPlayer : fightEndsPacket.getRedPlayers()) { + if (teamsIds.contains(SteamwarUser.get(redPlayer).getTeam())) { + return; + } + } + if (teamComboExistedAlready(fightEndsPacket.getBluePlayers(), fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode())) { return; }