forked from SteamWar/SteamWar
Migrate FightSystem modes and countdowns to GameCore
- Move shared arena-mode abstractions into GameCore - Adapt fight countdowns and APIs to the shared model - Add SteamWar issue audit workflow and SQL language settings
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
package de.steamwar.towerrun.game;
|
||||
|
||||
import de.steamwar.core.CraftbukkitWrapper;
|
||||
import de.steamwar.gamecore.wincondition.GameResult;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.towerrun.TowerRun;
|
||||
import de.steamwar.towerrun.config.Config;
|
||||
@@ -119,6 +120,14 @@ public class TowerRunGame {
|
||||
}
|
||||
}
|
||||
|
||||
public static void complete(GameResult<TowerRunPlayer> result) {
|
||||
if (result instanceof GameResult.Winner<TowerRunPlayer> winner) {
|
||||
win(winner.getWinner());
|
||||
} else {
|
||||
tie();
|
||||
}
|
||||
}
|
||||
|
||||
public static void win(TowerRunPlayer tPlayer) {
|
||||
Bukkit.getOnlinePlayers().forEach(player -> player.setGameMode(GameMode.SPECTATOR));
|
||||
PLAYERS_ALIVE.clear();
|
||||
|
||||
Reference in New Issue
Block a user