diff --git a/src/me/yaruma/fightsystem/fight/WaterRemover.java b/src/me/yaruma/fightsystem/fight/WaterRemover.java index 2df0aaf..0bc7ae3 100644 --- a/src/me/yaruma/fightsystem/fight/WaterRemover.java +++ b/src/me/yaruma/fightsystem/fight/WaterRemover.java @@ -35,7 +35,7 @@ public class WaterRemover { }, 0L, 20L); } - private void stop() { + public void stop() { if (this.task != null) { this.task.cancel(); } diff --git a/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java b/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java index f464926..0f71e3c 100644 --- a/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java +++ b/src/me/yaruma/fightsystem/winconditions/WinconditionTechKO.java @@ -64,10 +64,12 @@ public class WinconditionTechKO { Bukkit.getScheduler().cancelTask(taskID); Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + Config.TeamRedPrefix + Config.TeamRedName + " §6ist Tech K.O. !"); FightSystem.getPlugin().setSpectateState(Fight.getBlueTeam()); + FightSystem.getPlugin().getWaterRemover().stop(); } else if(teamBlueWater.isEmpty()) { Bukkit.getScheduler().cancelTask(taskID); Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + Config.TeamBluePrefix + Config.TeamBlueName + " §6ist Tech K.O. !"); FightSystem.getPlugin().setSpectateState(Fight.getRedTeam()); + FightSystem.getPlugin().getWaterRemover().stop(); } Bukkit.broadcastMessage("RedList: " + teamRedWater.size()); Bukkit.broadcastMessage("BlueList: " + teamBlueWater.size()); @@ -88,14 +90,15 @@ public class WinconditionTechKO { Bukkit.getScheduler().cancelTask(taskID); Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + Config.TeamRedPrefix + Config.TeamRedName + " §6ist Tech K.O. !"); FightSystem.getPlugin().setSpectateState(Fight.getBlueTeam()); + FightSystem.getPlugin().getWaterRemover().stop(); } //Team Blue Iterator itrBlue = teamBlueWater.iterator(); - while (itrRed.hasNext()) { - Location location = (Location) itrRed.next(); + while (itrBlue.hasNext()) { + Location location = (Location) itrBlue.next(); if(location.getBlock().getType() != Material.WATER && location.getBlock().getType() != Material.STATIONARY_WATER) { - itrRed.remove(); + itrBlue.remove(); Bukkit.broadcastMessage("blue remove" + teamBlueWater.size()); } } @@ -103,6 +106,7 @@ public class WinconditionTechKO { Bukkit.getScheduler().cancelTask(taskID); Bukkit.broadcastMessage(FightSystem.PREFIX + "§6Das Team " + Config.TeamBluePrefix + Config.TeamBlueName + " §6ist Tech K.O. !"); FightSystem.getPlugin().setSpectateState(Fight.getRedTeam()); + FightSystem.getPlugin().getWaterRemover().stop(); } }