Fix Outside Listener
Dieser Commit ist enthalten in:
Ursprung
edb5e26c89
Commit
ea93e43440
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren