From ea93e43440736b4ec5afa12c68d9c68c68e88e8d Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 17 Aug 2023 17:59:48 +0200 Subject: [PATCH] Fix Outside Listener --- .../towerrun/winconditions/LastRemainingWincondition.java | 1 - .../steamwar/towerrun/winconditions/OutsideWincondition.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/towerrun/winconditions/LastRemainingWincondition.java b/src/de/steamwar/towerrun/winconditions/LastRemainingWincondition.java index 6887df6..2d28596 100644 --- a/src/de/steamwar/towerrun/winconditions/LastRemainingWincondition.java +++ b/src/de/steamwar/towerrun/winconditions/LastRemainingWincondition.java @@ -39,7 +39,6 @@ public class LastRemainingWincondition extends WinCondition { TowerRunPlayer tPlayer = TowerRunPlayer.get(event.getEntity()); TowerRunGame.PLAYERS_ALIVE.remove(tPlayer); TowerRunGame.PLAYERS_ESCAPED.remove(tPlayer); - tPlayer.player().teleport(WorldConfig.SPAWN); tPlayer.player().setGameMode(GameMode.SPECTATOR); if (TowerRunGame.PLAYERS_ALIVE.size() == 1 && TowerRunGame.PLAYERS_ESCAPED.isEmpty()) { TowerRunGame.win(TowerRunGame.PLAYERS_ALIVE.get(0)); diff --git a/src/de/steamwar/towerrun/winconditions/OutsideWincondition.java b/src/de/steamwar/towerrun/winconditions/OutsideWincondition.java index dc91cd8..3c34324 100644 --- a/src/de/steamwar/towerrun/winconditions/OutsideWincondition.java +++ b/src/de/steamwar/towerrun/winconditions/OutsideWincondition.java @@ -22,6 +22,7 @@ package de.steamwar.towerrun.winconditions; import de.steamwar.towerrun.config.WorldConfig; import de.steamwar.towerrun.game.TowerRunGame; import de.steamwar.towerrun.game.TowerRunPlayer; +import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerMoveEvent; @@ -51,9 +52,6 @@ public abstract class OutsideWincondition extends WinCondition { return; } - System.out.println("-".repeat(20)); - System.out.println(event.getTo().getY() - event.getFrom().getY()); - if (event.getTo().getY() - event.getFrom().getY() == 0) { return; } @@ -64,5 +62,6 @@ public abstract class OutsideWincondition extends WinCondition { protected void outside(TowerRunPlayer towerRunPlayer) { TowerRunGame.PLAYERS_ESCAPED.add(towerRunPlayer); TowerRunGame.PLAYERS_ALIVE.remove(towerRunPlayer); + towerRunPlayer.player().setGameMode(GameMode.SPECTATOR); } }