Archiviert
13
0

Merge branch 'master' into tower-generator

# Conflicts:
#	src/de/steamwar/towerrun/TowerRun.java
Dieser Commit ist enthalten in:
yoyosource 2023-08-19 18:38:30 +02:00
Commit 554bdea9a0
4 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -37,6 +37,7 @@ public class Config {
public static final int LOBBY_TIMER; public static final int LOBBY_TIMER;
public static final Set<Material> DESTROYABLE_BLOCKS; public static final Set<Material> DESTROYABLE_BLOCKS;
public static final int GAME_TIMER; public static final int GAME_TIMER;
public static final int GAME_ESCAPE_TIMER;
static { static {
File configFile = new File(TowerRun.getInstance().getDataFolder(), "config.yml"); File configFile = new File(TowerRun.getInstance().getDataFolder(), "config.yml");
@ -50,6 +51,7 @@ public class Config {
MIN_PLAYERS = config.getInt("minPlayers"); MIN_PLAYERS = config.getInt("minPlayers");
LOBBY_TIMER = config.getInt("lobbyTimer"); LOBBY_TIMER = config.getInt("lobbyTimer");
GAME_TIMER = config.getInt("gameTimer", 20 * 60); 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())); 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 timeMinutes = Math.floorDiv(time, 60);
int timeSeconds = 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; package de.steamwar.towerrun.winconditions;
import de.steamwar.towerrun.TowerRun; import de.steamwar.towerrun.TowerRun;
import de.steamwar.towerrun.config.Config;
import de.steamwar.towerrun.config.WorldConfig; import de.steamwar.towerrun.config.WorldConfig;
import de.steamwar.towerrun.game.TowerRunGame; import de.steamwar.towerrun.game.TowerRunGame;
import de.steamwar.towerrun.game.TowerRunPlayer; import de.steamwar.towerrun.game.TowerRunPlayer;
@ -65,5 +66,8 @@ public abstract class OutsideWincondition extends WinCondition {
TowerRunGame.PLAYERS_ALIVE.remove(towerRunPlayer); TowerRunGame.PLAYERS_ALIVE.remove(towerRunPlayer);
towerRunPlayer.player().setGameMode(GameMode.SPECTATOR); towerRunPlayer.player().setGameMode(GameMode.SPECTATOR);
TowerRun.getMessage().broadcast("PLAYER_ESCAPE", towerRunPlayer.player().getName()); TowerRun.getMessage().broadcast("PLAYER_ESCAPE", towerRunPlayer.player().getName());
if (TowerRunGame.PLAYERS_ESCAPED.size() == 1) {
TowerRun.getGameCountdown().setTime(Config.GAME_ESCAPE_TIMER);
}
} }
} }