From 513bcaee11cf373d1a69c71550a8dfd2f0be5cfb Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 6 Sep 2019 20:06:05 +0200 Subject: [PATCH] + fixing wrong team wins bug --- src/de/steamwar/fightsystem/FightSystem.java | 4 ++-- src/de/steamwar/fightsystem/utils/sql/EventFight.java | 1 + .../fightsystem/winconditions/EventTeamOffWincondition.java | 2 +- .../fightsystem/winconditions/WinconditionWaterTechKO.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/fightsystem/FightSystem.java b/src/de/steamwar/fightsystem/FightSystem.java index 4a43a03..2ae6b0c 100644 --- a/src/de/steamwar/fightsystem/FightSystem.java +++ b/src/de/steamwar/fightsystem/FightSystem.java @@ -105,6 +105,8 @@ public class FightSystem extends JavaPlugin { setAllPlayersGM(GameMode.SURVIVAL); Bukkit.broadcastMessage(PREFIX + "§aDer Kampf beginnt!"); + new PreRunningCountdown(); + new WinconditionAllDead(); new WinconditionCaptainDead(); new WinconditionWaterTechKO(); @@ -113,8 +115,6 @@ public class FightSystem extends JavaPlugin { if(Config.event()){ new EventTeamOffWincondition(); } - - new PreRunningCountdown(); } public static void setRunningState() { diff --git a/src/de/steamwar/fightsystem/utils/sql/EventFight.java b/src/de/steamwar/fightsystem/utils/sql/EventFight.java index 98eaa5c..237ab28 100644 --- a/src/de/steamwar/fightsystem/utils/sql/EventFight.java +++ b/src/de/steamwar/fightsystem/utils/sql/EventFight.java @@ -28,6 +28,7 @@ public class EventFight { public static EventFight get(int fightID){ ResultSet rs = Core.sql.select("SELECT * FROM EventFight WHERE FightID = " + fightID); try{ + rs.next(); return new EventFight( rs.getInt("EventID"), fightID, diff --git a/src/de/steamwar/fightsystem/winconditions/EventTeamOffWincondition.java b/src/de/steamwar/fightsystem/winconditions/EventTeamOffWincondition.java index 139c7bf..ce03f7a 100644 --- a/src/de/steamwar/fightsystem/winconditions/EventTeamOffWincondition.java +++ b/src/de/steamwar/fightsystem/winconditions/EventTeamOffWincondition.java @@ -15,7 +15,7 @@ public class EventTeamOffWincondition { private void teamOff(FightTeam team){ if(team.allPlayersOut()){ Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + team.getName() + " §6ist Offline!"); - FightSystem.setSpectateState(team); + FightSystem.setSpectateState(Fight.getOpposite(team)); } } } \ No newline at end of file diff --git a/src/de/steamwar/fightsystem/winconditions/WinconditionWaterTechKO.java b/src/de/steamwar/fightsystem/winconditions/WinconditionWaterTechKO.java index b725169..15adf98 100644 --- a/src/de/steamwar/fightsystem/winconditions/WinconditionWaterTechKO.java +++ b/src/de/steamwar/fightsystem/winconditions/WinconditionWaterTechKO.java @@ -89,7 +89,7 @@ public class WinconditionWaterTechKO { private static void checkEmpty(FightTeam team, Set teamWater){ if(teamWater.isEmpty()){ Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + team.getName() + " §6ist Tech K.O.!"); - FightSystem.setSpectateState(team); + FightSystem.setSpectateState(Fight.getOpposite(team)); } } }