Archiviert
13
0

tower-generator #6

Zusammengeführt
YoyoNow hat 16 Commits von tower-generator nach master 2023-09-23 21:29:06 +02:00 zusammengeführt
4 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen
Nur Änderungen aus Commit 554bdea9a0 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -56,6 +56,10 @@ public class TowerRun extends JavaPlugin {
@Getter
private static TowerGenerator towerGenerator = null;
@Getter
private static GameCountdown gameCountdown;
@Override
public void onEnable() {
instance = this;
@ -73,7 +77,7 @@ public class TowerRun extends JavaPlugin {
final LobbyCountdown lobbyCountdown = new LobbyCountdown();
new EndCountdown(lobbyCountdown);
new StartCommand(lobbyCountdown);
new GameCountdown();
gameCountdown = new GameCountdown();
TowerRunGame.reset();
}

Datei anzeigen

@ -37,6 +37,7 @@ public class Config {
public static final int LOBBY_TIMER;
public static final Set<Material> DESTROYABLE_BLOCKS;
public static final int GAME_TIMER;
public static final int GAME_ESCAPE_TIMER;
static {
File configFile = new File(TowerRun.getInstance().getDataFolder(), "config.yml");
@ -50,6 +51,7 @@ public class Config {
MIN_PLAYERS = config.getInt("minPlayers");
LOBBY_TIMER = config.getInt("lobbyTimer");
GAME_TIMER = config.getInt("gameTimer", 20 * 60);
GAME_ESCAPE_TIMER = config.getInt("gameEscapeTimer", 60);
DESTROYABLE_BLOCKS = EnumSet.copyOf(config.getStringList("destroyable").stream().map(Material::valueOf).collect(Collectors.toSet()));
}

Datei anzeigen

@ -56,6 +56,6 @@ public class GameCountdown extends Countdown {
int timeMinutes = Math.floorDiv(time, 60);
int timeSeconds = time % 60;
TowerRun.getMessage().broadcastActionbar("GAME_TIME", timeMinutes, timeSeconds);
TowerRun.getMessage().broadcastActionbar("GAME_TIME", String.format("%02d", timeMinutes), String.format("%02d", timeSeconds));
}
}

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.towerrun.winconditions;
import de.steamwar.towerrun.TowerRun;
import de.steamwar.towerrun.config.Config;
import de.steamwar.towerrun.config.WorldConfig;
import de.steamwar.towerrun.game.TowerRunGame;
import de.steamwar.towerrun.game.TowerRunPlayer;
@ -65,5 +66,8 @@ public abstract class OutsideWincondition extends WinCondition {
TowerRunGame.PLAYERS_ALIVE.remove(towerRunPlayer);
towerRunPlayer.player().setGameMode(GameMode.SPECTATOR);
TowerRun.getMessage().broadcast("PLAYER_ESCAPE", towerRunPlayer.player().getName());
if (TowerRunGame.PLAYERS_ESCAPED.size() == 1) {
TowerRun.getGameCountdown().setTime(Config.GAME_ESCAPE_TIMER);
}
}
}