11package net .onelitefeather .cygnus .phase ;
22
3+ import net .onelitefeather .cygnus .common .config .GameConfig ;
34import net .theevilreaper .aves .util .functional .VoidConsumer ;
45import net .theevilreaper .xerus .api .phase .TickDirection ;
56import net .theevilreaper .xerus .api .phase .TimedPhase ;
1516import static net .onelitefeather .cygnus .common .config .GameConfig .FORCE_START_TIME ;
1617
1718/**
19+ * Represents the lobby phase of the game.
20+ *
21+ * <p>During this phase the game waits until enough players joined to start the
22+ * match countdown. The phase updates the player level and experience bar to
23+ * visualize the remaining time until the game starts.</p>
24+ *
25+ * <p>The phase can be paused automatically if the required player count is not
26+ * reached anymore. It also supports force starting the game with a reduced
27+ * countdown duration.</p>
28+ *
29+ * <p>While the countdown is running, the game map loading and stamina
30+ * initialization are triggered at specific countdown timestamps.</p>
31+ *
1832 * @author theEvilReaper
1933 * @version 1.0.0
2034 * @since 1.0.0
21- ** /
35+ */
2236public final class LobbyPhase extends TimedPhase {
2337
2438 private static final ConnectionManager CONNECTION_MANAGER = MinecraftServer .getConnectionManager ();
@@ -33,14 +47,13 @@ public final class LobbyPhase extends TimedPhase {
3347 public LobbyPhase (
3448 VoidConsumer gameMapLoading ,
3549 VoidConsumer staminaInstantiation ,
36- int lobbyTime ,
37- int minPlayers
50+ GameConfig gameConfig
3851 ) {
3952 super ("Lobby" , ChronoUnit .SECONDS , 1 );
4053 this .gameMapLoading = gameMapLoading ;
4154 this .staminaInstantiation = staminaInstantiation ;
42- this .lobbyTime = lobbyTime ;
43- this .minPlayers = minPlayers ;
55+ this .lobbyTime = gameConfig . lobbyTime () ;
56+ this .minPlayers = gameConfig . minPlayers () ;
4457 this .setPaused (true );
4558 this .setCurrentTicks (lobbyTime );
4659 this .setTickDirection (TickDirection .DOWN );
0 commit comments