Archiviert
13
0

Fix Outside Listener

Dieser Commit ist enthalten in:
Chaoscaot 2023-08-17 17:59:48 +02:00
Ursprung edb5e26c89
Commit ea93e43440
Signiert von: Chaoscaot
GPG-Schlüssel-ID: BDF8FADD7D5EDB7A
2 geänderte Dateien mit 2 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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));

Datei anzeigen

@ -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);
}
}