Sfoglia il codice sorgente

Renaming and moving `lobby.class`

RedstoneFuture 7 mesi fa
parent
commit
05dd85af0d
23 ha cambiato i file con 134 aggiunte e 137 eliminazioni
  1. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommandCompletions.java
  2. 3 3
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java
  3. 16 16
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/SetupCommands.java
  4. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java
  5. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/game/GameConfig.java
  6. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/game/GameTeamConfiguration.java
  7. 31 31
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java
  8. 4 4
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameJoinManager.java
  9. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameLeaveManager.java
  10. 19 19
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java
  11. 6 6
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/MapVoting.java
  12. 6 6
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/TeamManager.java
  13. 23 23
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java
  14. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MotdManager.java
  15. 1 3
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java
  16. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java
  17. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/SignRepository.java
  18. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java
  19. 3 3
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java
  20. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java
  21. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java
  22. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java
  23. 4 5
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/menus/inventory/MapVoteMenu.java

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommandCompletions.java

@@ -88,7 +88,7 @@ public class MWCommandCompletions {
             Game game = GameManager.getInstance().getGame(player.getLocation());
             Game game = GameManager.getInstance().getGame(player.getLocation());
             if (game == null) return null;
             if (game == null) return null;
 
 
-            return game.getLobby().getPossibleArenas();
+            return game.getGameConfig().getPossibleArenas();
         });
         });
     }
     }
     
     

+ 3 - 3
missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java

@@ -89,11 +89,11 @@ public class MWCommands extends BaseCommand {
         for (Game game : GameManager.getInstance().getGames().values()) {
         for (Game game : GameManager.getInstance().getGames().values()) {
             TeamManager teamManager = game.getTeamManager();
             TeamManager teamManager = game.getTeamManager();
             
             
-            sender.sendMessage("§e " + game.getLobby().getName() 
-                    + "§7 -- Name: »" + game.getLobby().getDisplayName() 
+            sender.sendMessage("§e " + game.getGameConfig().getName() 
+                    + "§7 -- Name: »" + game.getGameConfig().getDisplayName() 
                     + "§7« | Status: " + game.getState());
                     + "§7« | Status: " + game.getState());
             
             
-            sender.sendMessage("§8 - §f" + "Load with startup: §7" + game.getLobby().isAutoLoad());
+            sender.sendMessage("§8 - §f" + "Load with startup: §7" + game.getGameConfig().isAutoLoad());
             
             
             sender.sendMessage("§8 - §f" + "Current Arena: §7" + ((game.getArena() != null) ? game.getArena().getName() : "?") 
             sender.sendMessage("§8 - §f" + "Current Arena: §7" + ((game.getArena() != null) ? game.getArena().getName() : "?") 
                     + "§7 -- Name: »" + ((game.getArena() != null) ? game.getArena().getDisplayName() : "?") + "§7«");
                     + "§7 -- Name: »" + ((game.getArena() != null) ? game.getArena().getDisplayName() : "?") + "§7«");

+ 16 - 16
missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/SetupCommands.java

@@ -241,8 +241,8 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
                 if (!isValidGame(args)) return;
 
 
-                game.getLobby().setSpawnPoint(player.getLocation());
-                game.getLobby().updateConfig();
+                game.getGameConfig().setSpawnPoint(player.getLocation());
+                game.getGameConfig().updateConfig();
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'spawnPoint' to " + player.getLocation() + ".");
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'spawnPoint' to " + player.getLocation() + ".");
             }
             }
 
 
@@ -252,7 +252,7 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
                 if (!isValidGame(args)) return;
 
 
-                player.teleport(game.getLobby().getSpawnPoint());
+                player.teleport(game.getGameConfig().getSpawnPoint());
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'spawnPoint'.");
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'spawnPoint'.");
             }
             }
 
 
@@ -267,8 +267,8 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
                 if (!isValidGame(args)) return;
 
 
-                game.getLobby().setAfterGameSpawn(player.getLocation());
-                game.getLobby().updateConfig();
+                game.getGameConfig().setAfterGameSpawn(player.getLocation());
+                game.getGameConfig().updateConfig();
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'afterGameSpawn' to " + player.getLocation() + ".");
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'afterGameSpawn' to " + player.getLocation() + ".");
             }
             }
 
 
@@ -278,7 +278,7 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
                 if (!isValidGame(args)) return;
 
 
-                player.teleport(game.getLobby().getAfterGameSpawn());
+                player.teleport(game.getGameConfig().getAfterGameSpawn());
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'afterGameSpawn'.");
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'afterGameSpawn'.");
             }
             }
 
 
@@ -296,9 +296,9 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
                     if (!isValidGame(args)) return;
 
 
-                    game.getLobby().getArea().setPosition1(player.getLocation());
-                    game.getLobby().setAreaConfig(game.getLobby().getArea().getAreaConfiguration());
-                    game.getLobby().updateConfig();
+                    game.getGameConfig().getArea().setPosition1(player.getLocation());
+                    game.getGameConfig().setAreaConfig(game.getGameConfig().getArea().getAreaConfiguration());
+                    game.getGameConfig().updateConfig();
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'lobby area' (position 1) to " + player.getLocation() + ".");
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'lobby area' (position 1) to " + player.getLocation() + ".");
                 }
                 }
 
 
@@ -308,8 +308,8 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
                     if (!isValidGame(args)) return;
 
 
-                    player.teleport(game.getLobby().getArea().getPosition1());
-                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'lobby area' (position 1): " + game.getLobby().getArea().getPosition1().toString());
+                    player.teleport(game.getGameConfig().getArea().getPosition1());
+                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'lobby area' (position 1): " + game.getGameConfig().getArea().getPosition1().toString());
                 }
                 }
 
 
             }
             }
@@ -323,9 +323,9 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
                     if (!isValidGame(args)) return;
 
 
-                    game.getLobby().getArea().setPosition2(player.getLocation());
-                    game.getLobby().setAreaConfig(game.getLobby().getArea().getAreaConfiguration());
-                    game.getLobby().updateConfig();
+                    game.getGameConfig().getArea().setPosition2(player.getLocation());
+                    game.getGameConfig().setAreaConfig(game.getGameConfig().getArea().getAreaConfiguration());
+                    game.getGameConfig().updateConfig();
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'lobby area' (position 2) to " + player.getLocation() + ".");
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'lobby area' (position 2) to " + player.getLocation() + ".");
                 }
                 }
 
 
@@ -335,8 +335,8 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
                     if (!isValidGame(args)) return;
 
 
-                    player.teleport(game.getLobby().getArea().getPosition2());
-                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'lobby area' (position 2): " + game.getLobby().getArea().getPosition2().toString());
+                    player.teleport(game.getGameConfig().getArea().getPosition2());
+                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'lobby area' (position 2): " + game.getGameConfig().getArea().getPosition2().toString());
                 }
                 }
 
 
             }
             }

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java

@@ -61,7 +61,7 @@ public class UserCommands extends BaseCommand {
             return;
             return;
         }
         }
         
         
-        if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING) {
+        if (game.getGameConfig().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_CANT_VOTE));
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_CANT_VOTE));
             return;
             return;
         }
         }
@@ -88,7 +88,7 @@ public class UserCommands extends BaseCommand {
             return;
             return;
         }
         }
         
         
-        if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING) {
+        if (game.getGameConfig().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_CANT_VOTE));
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_CANT_VOTE));
             return;
             return;
         }
         }

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/lobby/Lobby.java → missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/game/GameConfig.java

@@ -16,7 +16,7 @@
  * along with MissileWars.  If not, see <https://www.gnu.org/licenses/>.
  * along with MissileWars.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-package de.butzlabben.missilewars.configuration.lobby;
+package de.butzlabben.missilewars.configuration.game;
 
 
 import com.google.gson.annotations.SerializedName;
 import com.google.gson.annotations.SerializedName;
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.Logger;
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
 @Getter
 @Getter
 @ToString
 @ToString
 @RequiredArgsConstructor
 @RequiredArgsConstructor
-public class Lobby {
+public class GameConfig {
 
 
     // The values defined here are only valid if there is no Config yet.
     // The values defined here are only valid if there is no Config yet.
     private String name = "lobby0";
     private String name = "lobby0";

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/lobby/GameTeamConfiguration.java → missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/game/GameTeamConfiguration.java

@@ -16,7 +16,7 @@
  * along with MissileWars.  If not, see <https://www.gnu.org/licenses/>.
  * along with MissileWars.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-package de.butzlabben.missilewars.configuration.lobby;
+package de.butzlabben.missilewars.configuration.game;
 
 
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.Getter;

+ 31 - 31
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java

@@ -23,7 +23,7 @@ import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.PluginMessages;
 import de.butzlabben.missilewars.configuration.PluginMessages;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.configuration.arena.Arena;
-import de.butzlabben.missilewars.configuration.lobby.Lobby;
+import de.butzlabben.missilewars.configuration.game.GameConfig;
 import de.butzlabben.missilewars.event.GameStartEvent;
 import de.butzlabben.missilewars.event.GameStartEvent;
 import de.butzlabben.missilewars.event.GameStopEvent;
 import de.butzlabben.missilewars.event.GameStopEvent;
 import de.butzlabben.missilewars.game.enums.GameResult;
 import de.butzlabben.missilewars.game.enums.GameResult;
@@ -80,7 +80,7 @@ public class Game {
     private static int fights = 0;
     private static int fights = 0;
     private final Map<UUID, MWPlayer> players = new HashMap<>();
     private final Map<UUID, MWPlayer> players = new HashMap<>();
     private final MapVoting mapVoting = new MapVoting(this);
     private final MapVoting mapVoting = new MapVoting(this);
-    private final Lobby lobby;
+    private final GameConfig gameConfig;
     private final Map<UUID, BukkitTask> playerTasks = new HashMap<>();
     private final Map<UUID, BukkitTask> playerTasks = new HashMap<>();
     private final List<Location> portalBlocks = new ArrayList<>();
     private final List<Location> portalBlocks = new ArrayList<>();
     private TeamManager teamManager;
     private TeamManager teamManager;
@@ -99,30 +99,30 @@ public class Game {
     private TaskManager taskManager;
     private TaskManager taskManager;
     private int remainingGameDuration;
     private int remainingGameDuration;
     
     
-    public Game(Lobby lobby) {
-        Logger.BOOT.log("Loading lobby \"" + lobby.getName() + "\".");
-        this.lobby = lobby;
+    public Game(GameConfig gameConfig) {
+        Logger.BOOT.log("Loading lobby \"" + gameConfig.getName() + "\".");
+        this.gameConfig = gameConfig;
 
 
-        if (lobby.getBukkitWorld() == null) {
-            Logger.ERROR.log("Lobby world \"" + lobby.getName() + "\" must not be null");
+        if (gameConfig.getBukkitWorld() == null) {
+            Logger.ERROR.log("Lobby world \"" + gameConfig.getName() + "\" must not be null");
             return;
             return;
         }
         }
 
 
         try {
         try {
-            Serializer.setWorldAtAllLocations(lobby, lobby.getBukkitWorld());
+            Serializer.setWorldAtAllLocations(gameConfig, gameConfig.getBukkitWorld());
         } catch (Exception exception) {
         } catch (Exception exception) {
-            Logger.ERROR.log("Could not inject world object at lobby \"" + lobby.getName() + "\".");
+            Logger.ERROR.log("Could not inject world object at lobby \"" + gameConfig.getName() + "\".");
             exception.printStackTrace();
             exception.printStackTrace();
             return;
             return;
         }
         }
 
 
-        if (lobby.getPossibleArenas().isEmpty()) {
-            Logger.ERROR.log("At least one valid arena must be set at lobby \"" + lobby.getName() + "\".");
+        if (gameConfig.getPossibleArenas().isEmpty()) {
+            Logger.ERROR.log("At least one valid arena must be set at lobby \"" + gameConfig.getName() + "\".");
             return;
             return;
         }
         }
 
 
-        if (lobby.getPossibleArenas().stream().noneMatch(Arenas::existsArena)) {
-            Logger.ERROR.log("None of the specified arenas match a real arena for the lobby \"" + lobby.getName() + "\".");
+        if (gameConfig.getPossibleArenas().stream().noneMatch(Arenas::existsArena)) {
+            Logger.ERROR.log("None of the specified arenas match a real arena for the lobby \"" + gameConfig.getName() + "\".");
             return;
             return;
         }
         }
         
         
@@ -137,14 +137,14 @@ public class Game {
         taskManager = new TaskManager(this);
         taskManager = new TaskManager(this);
         taskManager.stopTimer();
         taskManager.stopTimer();
         updateGameListener(new LobbyListener(this));
         updateGameListener(new LobbyListener(this));
-        taskManager.setTimer(new LobbyTimer(this, lobby.getLobbyTime()));
+        taskManager.setTimer(new LobbyTimer(this, gameConfig.getLobbyTime()));
         taskManager.runTimer(0, 20);
         taskManager.runTimer(0, 20);
         state = GameState.LOBBY;
         state = GameState.LOBBY;
 
 
         Bukkit.getScheduler().runTaskLater(MissileWars.getInstance(), () -> applyForAllPlayers(player -> gameJoinManager.runTeleportEventForPlayer(player)), 2);
         Bukkit.getScheduler().runTaskLater(MissileWars.getInstance(), () -> applyForAllPlayers(player -> gameJoinManager.runTeleportEventForPlayer(player)), 2);
 
 
         if (Config.isSetup()) {
         if (Config.isSetup()) {
-            Logger.WARN.log("Did not fully initialize lobby \"" + lobby.getName() + "\" as the plugin is in setup mode");
+            Logger.WARN.log("Did not fully initialize lobby \"" + gameConfig.getName() + "\" as the plugin is in setup mode");
             return;
             return;
         }
         }
 
 
@@ -153,22 +153,22 @@ public class Game {
         gameLeaveManager = new GameLeaveManager(this);
         gameLeaveManager = new GameLeaveManager(this);
         
         
         // choose the game arena
         // choose the game arena
-        if (lobby.getMapChooseProcedure() == MapChooseProcedure.FIRST) {
-            setArena(lobby.getArenas().get(0));
+        if (gameConfig.getMapChooseProcedure() == MapChooseProcedure.FIRST) {
+            setArena(gameConfig.getArenas().get(0));
             prepareGame();
             prepareGame();
 
 
-        } else if (lobby.getMapChooseProcedure() == MapChooseProcedure.MAPCYCLE) {
-            final int lastMapIndex = cycles.getOrDefault(lobby.getName(), -1);
-            List<Arena> arenas = lobby.getArenas();
+        } else if (gameConfig.getMapChooseProcedure() == MapChooseProcedure.MAPCYCLE) {
+            final int lastMapIndex = cycles.getOrDefault(gameConfig.getName(), -1);
+            List<Arena> arenas = gameConfig.getArenas();
             int index = lastMapIndex >= arenas.size() - 1 ? 0 : lastMapIndex + 1;
             int index = lastMapIndex >= arenas.size() - 1 ? 0 : lastMapIndex + 1;
-            cycles.put(lobby.getName(), index);
+            cycles.put(gameConfig.getName(), index);
             setArena(arenas.get(index));
             setArena(arenas.get(index));
             prepareGame();
             prepareGame();
 
 
-        } else if (lobby.getMapChooseProcedure() == MapChooseProcedure.MAPVOTING) {
+        } else if (gameConfig.getMapChooseProcedure() == MapChooseProcedure.MAPVOTING) {
             if (mapVoting.onlyOneArenaFound()) {
             if (mapVoting.onlyOneArenaFound()) {
-                setArena(lobby.getArenas().get(0));
-                Logger.WARN.log("Only one arena was found for the lobby \"" + lobby.getName() + "\". The configured map voting was skipped.");
+                setArena(gameConfig.getArenas().get(0));
+                Logger.WARN.log("Only one arena was found for the lobby \"" + gameConfig.getName() + "\". The configured map voting was skipped.");
                 prepareGame();
                 prepareGame();
             } else {
             } else {
                 mapVoting.startVote();
                 mapVoting.startVote();
@@ -297,7 +297,7 @@ public class Game {
             return;
             return;
         }
         }
 
 
-        GameManager.getInstance().restartGame(lobby, false);
+        GameManager.getInstance().restartGame(gameConfig, false);
     }
     }
 
 
     public void appendRestart() {
     public void appendRestart() {
@@ -351,7 +351,7 @@ public class Game {
      * @return true, if it's in the Lobby-Area
      * @return true, if it's in the Lobby-Area
      */
      */
     public boolean isInLobbyArea(Location location) {
     public boolean isInLobbyArea(Location location) {
-        return Geometry.isInsideIn(location, lobby.getArea());
+        return Geometry.isInsideIn(location, gameConfig.getArea());
     }
     }
 
 
     /**
     /**
@@ -655,7 +655,7 @@ public class Game {
      * @return (boolean) 'true' if to few players are in the lobby 
      * @return (boolean) 'true' if to few players are in the lobby 
      */
      */
     public boolean areToFewPlayers() {
     public boolean areToFewPlayers() {
-        int minSize = lobby.getMinPlayers();
+        int minSize = gameConfig.getMinPlayers();
         int currentSize = teamManager.getTeam1().getMembers().size() + teamManager.getTeam2().getMembers().size();
         int currentSize = teamManager.getTeam1().getMembers().size() + teamManager.getTeam2().getMembers().size();
         return currentSize < minSize;
         return currentSize < minSize;
     }
     }
@@ -668,7 +668,7 @@ public class Game {
      * @return (boolean) 'true' if to many players are in the lobby 
      * @return (boolean) 'true' if to many players are in the lobby 
      */
      */
     public boolean areTooManyPlayers() {
     public boolean areTooManyPlayers() {
-        int maxSize = lobby.getMaxPlayers();
+        int maxSize = gameConfig.getMaxPlayers();
         
         
         if (maxSize == -1) return false;
         if (maxSize == -1) return false;
         
         
@@ -682,7 +682,7 @@ public class Game {
      * @return (boolean) 'true' if to many spectators are in the lobby 
      * @return (boolean) 'true' if to many spectators are in the lobby 
      */
      */
     public boolean areTooManySpectators() {
     public boolean areTooManySpectators() {
-        int maxSize = lobby.getMaxSpectators();
+        int maxSize = gameConfig.getMaxSpectators();
         
         
         if (maxSize == -1) return false;
         if (maxSize == -1) return false;
         
         
@@ -736,7 +736,7 @@ public class Game {
     }
     }
 
 
     public void teleportToLobbySpawn(Player player) {
     public void teleportToLobbySpawn(Player player) {
-        Teleport.teleportSafely(player, lobby.getSpawnPoint());
+        Teleport.teleportSafely(player, gameConfig.getSpawnPoint());
     }
     }
 
 
     public void teleportToArenaSpectatorSpawn(Player player) {
     public void teleportToArenaSpectatorSpawn(Player player) {
@@ -744,7 +744,7 @@ public class Game {
     }
     }
 
 
     public void teleportToAfterGameSpawn(Player player) {
     public void teleportToAfterGameSpawn(Player player) {
-        Teleport.teleportSafely(player, lobby.getAfterGameSpawn());
+        Teleport.teleportSafely(player, gameConfig.getAfterGameSpawn());
     }
     }
     
     
     /**
     /**

+ 4 - 4
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameJoinManager.java

@@ -215,7 +215,7 @@ public class GameJoinManager {
             broadcastMsg = PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_PLAYER_JOINED);
             broadcastMsg = PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_PLAYER_JOINED);
         }
         }
         
         
-        game.broadcast(broadcastMsg.replace("%max_players%", Integer.toString(game.getLobby().getMaxPlayers()))
+        game.broadcast(broadcastMsg.replace("%max_players%", Integer.toString(game.getGameConfig().getMaxPlayers()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%player%", player.getName())
                 .replace("%player%", player.getName())
                 .replace("%team%", (mwPlayer.getTeam() != null) ? mwPlayer.getTeam().getFullname() : "?"));
                 .replace("%team%", (mwPlayer.getTeam() != null) ? mwPlayer.getTeam().getFullname() : "?"));
@@ -231,7 +231,7 @@ public class GameJoinManager {
             broadcastMsg = PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_PLAYER_SWITCHED);
             broadcastMsg = PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_PLAYER_SWITCHED);
         }
         }
         
         
-        game.broadcast(broadcastMsg.replace("%max_players%", Integer.toString(game.getLobby().getMaxPlayers()))
+        game.broadcast(broadcastMsg.replace("%max_players%", Integer.toString(game.getGameConfig().getMaxPlayers()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%player%", player.getName())
                 .replace("%player%", player.getName())
                 .replace("%from%", oldTeam.getFullname())
                 .replace("%from%", oldTeam.getFullname())
@@ -257,7 +257,7 @@ public class GameJoinManager {
             }
             }
         }
         }
         
         
-        player.sendMessage(privateMsg.replace("%max_players%", Integer.toString(game.getLobby().getMaxPlayers()))
+        player.sendMessage(privateMsg.replace("%max_players%", Integer.toString(game.getGameConfig().getMaxPlayers()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%players%", Integer.toString(game.getPlayerAmount()))
                 .replace("%player%", player.getName())
                 .replace("%player%", player.getName())
                 .replace("%team%", (mwPlayer.getTeam() != null) ? mwPlayer.getTeam().getFullname() : "?"));
                 .replace("%team%", (mwPlayer.getTeam() != null) ? mwPlayer.getTeam().getFullname() : "?"));
@@ -286,7 +286,7 @@ public class GameJoinManager {
      */
      */
     public void runTeleportEventForPlayer(Player player) {
     public void runTeleportEventForPlayer(Player player) {
         Bukkit.getPluginManager().callEvent(new PlayerTeleportEvent(player,
         Bukkit.getPluginManager().callEvent(new PlayerTeleportEvent(player,
-                Config.getFallbackSpawn(), game.getLobby().getSpawnPoint()));
+                Config.getFallbackSpawn(), game.getGameConfig().getSpawnPoint()));
     }
     }
     
     
 }
 }

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameLeaveManager.java

@@ -68,7 +68,7 @@ public class GameLeaveManager {
         }
         }
 
 
         if (message != null) {
         if (message != null) {
-            game.broadcast(message.replace("%max_players%", Integer.toString(game.getLobby().getMaxPlayers()))
+            game.broadcast(message.replace("%max_players%", Integer.toString(game.getGameConfig().getMaxPlayers()))
                     .replace("%players%", Integer.toString(game.getPlayerAmount()))
                     .replace("%players%", Integer.toString(game.getPlayerAmount()))
                     .replace("%player%", player.getName())
                     .replace("%player%", player.getName())
                     .replace("%team%", team.getFullname()));
                     .replace("%team%", team.getFullname()));
@@ -77,7 +77,7 @@ public class GameLeaveManager {
         player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
         player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
         
         
         if (game.getState() == GameState.LOBBY) {
         if (game.getState() == GameState.LOBBY) {
-            player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.LOBBY_LEFT).replace("%lobby_name%", game.getLobby().getDisplayName()));
+            player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.LOBBY_LEFT).replace("%lobby_name%", game.getGameConfig().getDisplayName()));
         } else if (game.getState() == GameState.INGAME) {
         } else if (game.getState() == GameState.INGAME) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_LEFT).replace("%arena_name%", game.getArena().getDisplayName()));
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.GAME_LEFT).replace("%arena_name%", game.getArena().getDisplayName()));
         }
         }

+ 19 - 19
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java

@@ -21,7 +21,7 @@ package de.butzlabben.missilewars.game;
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.Config;
-import de.butzlabben.missilewars.configuration.lobby.Lobby;
+import de.butzlabben.missilewars.configuration.game.GameConfig;
 import de.butzlabben.missilewars.game.enums.GameState;
 import de.butzlabben.missilewars.game.enums.GameState;
 import de.butzlabben.missilewars.util.geometry.GameArea;
 import de.butzlabben.missilewars.util.geometry.GameArea;
 import de.butzlabben.missilewars.util.serialization.Serializer;
 import de.butzlabben.missilewars.util.serialization.Serializer;
@@ -54,7 +54,7 @@ public class GameManager {
         
         
         for (Game game : gamesListCache) {
         for (Game game : gamesListCache) {
             game.setState(GameState.END);
             game.setState(GameState.END);
-            restartGame(game.getLobby(), false);
+            restartGame(game.getGameConfig(), false);
         }
         }
     }
     }
 
 
@@ -81,7 +81,7 @@ public class GameManager {
             File file = new File(lobbiesFolder, Config.getDefaultLobby());
             File file = new File(lobbiesFolder, Config.getDefaultLobby());
             try {
             try {
                 file.createNewFile();
                 file.createNewFile();
-                Serializer.serialize(file, new Lobby());
+                Serializer.serialize(file, new GameConfig());
             } catch (IOException exception) {
             } catch (IOException exception) {
                 Logger.ERROR.log("Could not create default arena config");
                 Logger.ERROR.log("Could not create default arena config");
                 Logger.ERROR.log("As there are no arenas present, the plugin is shutting down");
                 Logger.ERROR.log("As there are no arenas present, the plugin is shutting down");
@@ -110,20 +110,20 @@ public class GameManager {
         Logger.BOOT.log("Try to loading lobby of \"" + lobbyFile.getName() + "\"");
         Logger.BOOT.log("Try to loading lobby of \"" + lobbyFile.getName() + "\"");
 
 
         try {
         try {
-            Lobby lobby = Serializer.deserialize(lobbyFile, Lobby.class);
+            GameConfig gameConfig = Serializer.deserialize(lobbyFile, GameConfig.class);
 
 
-            if (lobby == null) {
+            if (gameConfig == null) {
                 Logger.ERROR.log("Could not load lobby of \"" + lobbyFile.getName() + "\"");
                 Logger.ERROR.log("Could not load lobby of \"" + lobbyFile.getName() + "\"");
                 return;
                 return;
             }
             }
 
 
-            if (getGame(lobby.getName()) != null) {
+            if (getGame(gameConfig.getName()) != null) {
                 Logger.ERROR.log("A lobby with the same name was already loaded. Names of lobbies must be unique, this lobby will not be loaded");
                 Logger.ERROR.log("A lobby with the same name was already loaded. Names of lobbies must be unique, this lobby will not be loaded");
                 return;
                 return;
             }
             }
 
 
-            lobby.setFile(lobbyFile);
-            restartGame(lobby, false);
+            gameConfig.setFile(lobbyFile);
+            restartGame(gameConfig, false);
 
 
         } catch (IOException exception) {
         } catch (IOException exception) {
             Logger.ERROR.log("Could not load lobby of \"" + lobbyFile.getName() + "\"");
             Logger.ERROR.log("Could not load lobby of \"" + lobbyFile.getName() + "\"");
@@ -134,14 +134,14 @@ public class GameManager {
     /**
     /**
      * This method (re)starts a MissileWars game.
      * This method (re)starts a MissileWars game.
      *
      *
-     * @param targetLobby (Lobby) the existing lobby of the game
+     * @param targetGameConfig (Lobby) the existing lobby of the game
      * @param forceStart  true, if it should also (re)start, if it's not an automatically
      * @param forceStart  true, if it should also (re)start, if it's not an automatically
      *                    starting game according to the lobby configuration
      *                    starting game according to the lobby configuration
      */
      */
-    public void restartGame(Lobby targetLobby, boolean forceStart) {
-        if (!targetLobby.isAutoLoad() && !forceStart) return;
+    public void restartGame(GameConfig targetGameConfig, boolean forceStart) {
+        if (!targetGameConfig.isAutoLoad() && !forceStart) return;
 
 
-        String targetLobbyName = targetLobby.getName();
+        String targetLobbyName = targetGameConfig.getName();
 
 
         // reset the old game
         // reset the old game
         Game game = getGame(targetLobbyName);
         Game game = getGame(targetLobbyName);
@@ -156,16 +156,16 @@ public class GameManager {
 
 
         // read the game lobby configuration and build a new game and lobby from it
         // read the game lobby configuration and build a new game and lobby from it
         try {
         try {
-            Lobby lobby = Serializer.deserialize(targetLobby.getFile(), Lobby.class);
-            lobby.setFile(targetLobby.getFile());
-            lobby.setArea(new GameArea(lobby.getBukkitWorld(), lobby.getAreaConfig()));
-            lobby.updateConfig();
+            GameConfig gameConfig = Serializer.deserialize(targetGameConfig.getFile(), GameConfig.class);
+            gameConfig.setFile(targetGameConfig.getFile());
+            gameConfig.setArea(new GameArea(gameConfig.getBukkitWorld(), gameConfig.getAreaConfig()));
+            gameConfig.updateConfig();
 
 
-            Logger.BOOTDONE.log("Reloaded lobby \"" + targetLobbyName + "\" (" + targetLobby.getFile().getName() + ")");
-            addGame(targetLobbyName, new Game(lobby));
+            Logger.BOOTDONE.log("Reloaded lobby \"" + targetLobbyName + "\" (" + targetGameConfig.getFile().getName() + ")");
+            addGame(targetLobbyName, new Game(gameConfig));
 
 
         } catch (IOException exception) {
         } catch (IOException exception) {
-            Logger.ERROR.log("Could not load lobby of \"" + targetLobby.getFile().getName() + "\"");
+            Logger.ERROR.log("Could not load lobby of \"" + targetGameConfig.getFile().getName() + "\"");
             exception.printStackTrace();
             exception.printStackTrace();
         }
         }
     }
     }

+ 6 - 6
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/MapVoting.java

@@ -66,7 +66,7 @@ public class MapVoting {
             return;
             return;
         }
         }
         
         
-        if (!game.getLobby().getArenas().contains(arena)) {
+        if (!game.getGameConfig().getArenas().contains(arena)) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_MAP_NOT_AVAILABLE));
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_MAP_NOT_AVAILABLE));
             return;
             return;
         }
         }
@@ -99,7 +99,7 @@ public class MapVoting {
     private Arena getVotedArena() {
     private Arena getVotedArena() {
 
 
         // If no one voted:
         // If no one voted:
-        if (arenaVotes.isEmpty()) return game.getLobby().getArenas().get(0);
+        if (arenaVotes.isEmpty()) return game.getGameConfig().getArenas().get(0);
 
 
         Arena arena = arenaVotes.values().stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
         Arena arena = arenaVotes.values().stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
                 .entrySet()
                 .entrySet()
@@ -124,7 +124,7 @@ public class MapVoting {
      * This method unlocks the map voting.
      * This method unlocks the map voting.
      */
      */
     public void startVote() {
     public void startVote() {
-        if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
+        if (game.getGameConfig().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
 
 
         state = VoteState.RUNNING;
         state = VoteState.RUNNING;
@@ -134,7 +134,7 @@ public class MapVoting {
      * This method locks the map voting again.
      * This method locks the map voting again.
      */
      */
     public void stopVote() {
     public void stopVote() {
-        if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
+        if (game.getGameConfig().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
 
 
         state = VoteState.FINISH;
         state = VoteState.FINISH;
@@ -147,14 +147,14 @@ public class MapVoting {
      * @return (Boolean) true, if only one map exists for this lobby
      * @return (Boolean) true, if only one map exists for this lobby
      */
      */
     public boolean onlyOneArenaFound() {
     public boolean onlyOneArenaFound() {
-        return (game.getLobby().getArenas().size() == 1);
+        return (game.getGameConfig().getArenas().size() == 1);
     }
     }
 
 
     /**
     /**
      * This method sets the selected arena of map voting for the current game.
      * This method sets the selected arena of map voting for the current game.
      */
      */
     public void setVotedArena() {
     public void setVotedArena() {
-        if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
+        if (game.getGameConfig().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING)
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
             throw new IllegalStateException("Defined map choose procedure is not \"MAPVOTING\"");
 
 
         if (onlyOneArenaFound()) return;
         if (onlyOneArenaFound()) return;

+ 6 - 6
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/TeamManager.java

@@ -19,7 +19,7 @@
 package de.butzlabben.missilewars.game;
 package de.butzlabben.missilewars.game;
 
 
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.configuration.lobby.Lobby;
+import de.butzlabben.missilewars.configuration.game.GameConfig;
 import de.butzlabben.missilewars.game.enums.TeamType;
 import de.butzlabben.missilewars.game.enums.TeamType;
 import lombok.Getter;
 import lombok.Getter;
 
 
@@ -31,7 +31,7 @@ import java.util.UUID;
 public class TeamManager {
 public class TeamManager {
     
     
     private final Game game;
     private final Game game;
-    private final Lobby lobby;
+    private final GameConfig gameConfig;
     
     
     @Getter private Team team1;
     @Getter private Team team1;
     @Getter private Team team2;
     @Getter private Team team2;
@@ -41,11 +41,11 @@ public class TeamManager {
     
     
     public TeamManager(Game game) {
     public TeamManager(Game game) {
         this.game = game;
         this.game = game;
-        this.lobby = game.getLobby();
+        this.gameConfig = game.getGameConfig();
         
         
-        team1 = new Team(lobby.getTeam1Config().getName(), lobby.getTeam1Config().getColor(), game, TeamType.PLAYER);
-        team2 = new Team(lobby.getTeam2Config().getName(), lobby.getTeam2Config().getColor(), game, TeamType.PLAYER);
-        teamSpec = new Team(lobby.getTeamConfigSpec().getName(), lobby.getTeamConfigSpec().getColor(), game, TeamType.SPECTATOR);
+        team1 = new Team(gameConfig.getTeam1Config().getName(), gameConfig.getTeam1Config().getColor(), game, TeamType.PLAYER);
+        team2 = new Team(gameConfig.getTeam2Config().getName(), gameConfig.getTeam2Config().getColor(), game, TeamType.PLAYER);
+        teamSpec = new Team(gameConfig.getTeamConfigSpec().getName(), gameConfig.getTeamConfigSpec().getColor(), game, TeamType.SPECTATOR);
         
         
         team1.initialTeam();
         team1.initialTeam();
         team2.initialTeam();
         team2.initialTeam();

+ 23 - 23
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java

@@ -19,7 +19,7 @@
 package de.butzlabben.missilewars.game.misc;
 package de.butzlabben.missilewars.game.misc;
 
 
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.MissileWars;
-import de.butzlabben.missilewars.configuration.lobby.Lobby;
+import de.butzlabben.missilewars.configuration.game.GameConfig;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.GameManager;
 import de.butzlabben.missilewars.game.GameManager;
@@ -93,61 +93,61 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
                 if (params.startsWith("arena_")) return noInformation;
                 if (params.startsWith("arena_")) return noInformation;
             }
             }
 
 
-            if (params.startsWith("lobby_")) params = params.replace("this", playerGame.getLobby().getName());
+            if (params.startsWith("lobby_")) params = params.replace("this", playerGame.getGameConfig().getName());
             if (params.startsWith("arena_")) params = params.replace("this", playerGame.getArena().getName());
             if (params.startsWith("arena_")) params = params.replace("this", playerGame.getArena().getName());
             
             
         }
         }
         
         
         for (Game game : GameManager.getInstance().getGames().values()) {
         for (Game game : GameManager.getInstance().getGames().values()) {
-            Lobby lobby = game.getLobby();
+            GameConfig gameConfig = game.getGameConfig();
             
             
             // %missilewars_lobby_gamestate_<lobby name or 'this'>%
             // %missilewars_lobby_gamestate_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_gamestate_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_gamestate_" + gameConfig.getName())) {
                 return game.getState().getGameStateMsg();
                 return game.getState().getGameStateMsg();
             }
             }
             
             
             // %missilewars_lobby_mapvote_state_<lobby name or 'this'>%
             // %missilewars_lobby_mapvote_state_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_mapvote_state_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_mapvote_state_" + gameConfig.getName())) {
                 return game.getMapVoting().getState().toString();
                 return game.getMapVoting().getState().toString();
             }
             }
 
 
             // %missilewars_lobby_displayname_<lobby name or 'this'>%
             // %missilewars_lobby_displayname_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_displayname_" + lobby.getName())) {
-                return lobby.getDisplayName();
+            if (params.equalsIgnoreCase("lobby_displayname_" + gameConfig.getName())) {
+                return gameConfig.getDisplayName();
             }
             }
             
             
             // %missilewars_lobby_team1_name_<lobby name or 'this'>%
             // %missilewars_lobby_team1_name_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_team1_name_" + lobby.getName())) {
-                return lobby.getTeam1Config().getName();
+            if (params.equalsIgnoreCase("lobby_team1_name_" + gameConfig.getName())) {
+                return gameConfig.getTeam1Config().getName();
             }
             }
             
             
             // %missilewars_lobby_team1_color_<lobby name or 'this'>%
             // %missilewars_lobby_team1_color_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_team1_color_" + lobby.getName())) {
-                return lobby.getTeam1Config().getColor();
+            if (params.equalsIgnoreCase("lobby_team1_color_" + gameConfig.getName())) {
+                return gameConfig.getTeam1Config().getColor();
             }
             }
             
             
             // %missilewars_lobby_team2_name_<lobby name or 'this'>%
             // %missilewars_lobby_team2_name_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_team2_name_" + lobby.getName())) {
-                return lobby.getTeam2Config().getName();
+            if (params.equalsIgnoreCase("lobby_team2_name_" + gameConfig.getName())) {
+                return gameConfig.getTeam2Config().getName();
             }
             }
             
             
             // %missilewars_lobby_team2_color_<lobby name or 'this'>%
             // %missilewars_lobby_team2_color_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_team2_color_" + lobby.getName())) {
-                return lobby.getTeam2Config().getColor();
+            if (params.equalsIgnoreCase("lobby_team2_color_" + gameConfig.getName())) {
+                return gameConfig.getTeam2Config().getColor();
             }
             }
             
             
             // %missilewars_lobby_mapchooseprocedure_<lobby name or 'this'>%
             // %missilewars_lobby_mapchooseprocedure_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_mapchooseprocedure_" + lobby.getName())) {
-                return lobby.getMapChooseProcedure().toString();
+            if (params.equalsIgnoreCase("lobby_mapchooseprocedure_" + gameConfig.getName())) {
+                return gameConfig.getMapChooseProcedure().toString();
             }
             }
             
             
             // %missilewars_lobby_gameduration_<lobby name or 'this'>%
             // %missilewars_lobby_gameduration_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_gameduration_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_gameduration_" + gameConfig.getName())) {
                 return Integer.toString(game.getGameDuration());
                 return Integer.toString(game.getGameDuration());
             }
             }
             
             
             // %missilewars_lobby_arenasize_X_<lobby name or 'this'>%
             // %missilewars_lobby_arenasize_X_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_arenasize_X_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_arenasize_X_" + gameConfig.getName())) {
                 if (game.getGameArea() != null) {
                 if (game.getGameArea() != null) {
                     return Integer.toString(game.getGameArea().getXSize());
                     return Integer.toString(game.getGameArea().getXSize());
                 } else {
                 } else {
@@ -156,7 +156,7 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
             }
             }
             
             
             // %missilewars_lobby_arenasize_Y_<lobby name or 'this'>%
             // %missilewars_lobby_arenasize_Y_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_arenasize_Y_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_arenasize_Y_" + gameConfig.getName())) {
                 if (game.getGameArea() != null) {
                 if (game.getGameArea() != null) {
                     return Integer.toString(game.getGameArea().getYSize());
                     return Integer.toString(game.getGameArea().getYSize());
                 } else {
                 } else {
@@ -165,7 +165,7 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
             }
             }
             
             
             // %missilewars_lobby_arenasize_Z_<lobby name or 'this'>%
             // %missilewars_lobby_arenasize_Z_<lobby name or 'this'>%
-            if (params.equalsIgnoreCase("lobby_arenasize_Z_" + lobby.getName())) {
+            if (params.equalsIgnoreCase("lobby_arenasize_Z_" + gameConfig.getName())) {
                 if (game.getGameArea() != null) {
                 if (game.getGameArea() != null) {
                     return Integer.toString(game.getGameArea().getZSize());
                     return Integer.toString(game.getGameArea().getZSize());
                 } else {
                 } else {
@@ -173,7 +173,7 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
                 }
                 }
             }
             }
             
             
-            for (Arena arena : lobby.getArenas()) {
+            for (Arena arena : gameConfig.getArenas()) {
 
 
                 // %missilewars_arena_displayname_<arena name or 'this'>%
                 // %missilewars_arena_displayname_<arena name or 'this'>%
                 if (params.equalsIgnoreCase("arena_displayname_" + arena.getName())) {
                 if (params.equalsIgnoreCase("arena_displayname_" + arena.getName())) {
@@ -197,7 +197,7 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
                 
                 
                 // %missilewars_player_lobby_displayname%
                 // %missilewars_player_lobby_displayname%
                 if (params.equalsIgnoreCase("player_lobby_displayname")) {
                 if (params.equalsIgnoreCase("player_lobby_displayname")) {
-                    return mwPlayer.getGame().getLobby().getDisplayName();
+                    return mwPlayer.getGame().getGameConfig().getDisplayName();
                 }
                 }
                 
                 
                 // %missilewars_player_team_name%
                 // %missilewars_player_team_name%

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MotdManager.java

@@ -53,7 +53,7 @@ public class MotdManager {
             }
             }
             
             
             motd = ChatColor.translateAlternateColorCodes('&', newMotd)
             motd = ChatColor.translateAlternateColorCodes('&', newMotd)
-                    .replace("%max_players%", Integer.toString(game.getLobby().getMaxPlayers()))
+                    .replace("%max_players%", Integer.toString(game.getGameConfig().getMaxPlayers()))
                     .replace("%players%", Integer.toString(game.getPlayerAmount()))
                     .replace("%players%", Integer.toString(game.getPlayerAmount()))
                     .replace("%prefix%", PluginMessages.getPrefix());
                     .replace("%prefix%", PluginMessages.getPrefix());
         }
         }

+ 1 - 3
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java

@@ -21,13 +21,11 @@ package de.butzlabben.missilewars.game.misc;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.Team;
 import de.butzlabben.missilewars.game.Team;
-import de.butzlabben.missilewars.game.enums.GameState;
 import de.butzlabben.missilewars.player.MWPlayer;
 import de.butzlabben.missilewars.player.MWPlayer;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.Setter;
 import lombok.Setter;
 import org.bukkit.Bukkit;
 import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
 import org.bukkit.scoreboard.DisplaySlot;
 import org.bukkit.scoreboard.DisplaySlot;
 import org.bukkit.scoreboard.Objective;
 import org.bukkit.scoreboard.Objective;
 import org.bukkit.scoreboard.Scoreboard;
 import org.bukkit.scoreboard.Scoreboard;
@@ -249,7 +247,7 @@ public class ScoreboardManager {
         text = text.replace("%team1_amount%", Integer.toString(team1.getMembers().size()));
         text = text.replace("%team1_amount%", Integer.toString(team1.getMembers().size()));
         text = text.replace("%team2_amount%", Integer.toString(team2.getMembers().size()));
         text = text.replace("%team2_amount%", Integer.toString(team2.getMembers().size()));
 
 
-        text = text.replace("%lobby_name%", game.getLobby().getDisplayName());
+        text = text.replace("%lobby_name%", game.getGameConfig().getDisplayName());
         text = text.replace("%arena_name%", arenaDisplayName);
         text = text.replace("%arena_name%", arenaDisplayName);
 
 
         text = text.replace("%time%", Integer.toString(game.getGameDuration()));
         text = text.replace("%time%", Integer.toString(game.getGameDuration()));

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java

@@ -95,7 +95,7 @@ public class MWSign {
             
             
             switch (game.getState()) {
             switch (game.getState()) {
                 case LOBBY:
                 case LOBBY:
-                    name = game.getLobby().getDisplayName();
+                    name = game.getGameConfig().getDisplayName();
                     break;
                     break;
                 case INGAME:
                 case INGAME:
                 case END:
                 case END:
@@ -104,7 +104,7 @@ public class MWSign {
             }
             }
         }
         }
 
 
-        int maxPlayers = (game == null ? 0 : game.getLobby().getMaxPlayers());
+        int maxPlayers = (game == null ? 0 : game.getGameConfig().getMaxPlayers());
         int players = (game == null ? 0 : game.getPlayerAmount());
         int players = (game == null ? 0 : game.getPlayerAmount());
 
 
         return line.replace("%state%", gameStateMsg)
         return line.replace("%state%", gameStateMsg)

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/SignRepository.java

@@ -109,6 +109,6 @@ public class SignRepository {
     }
     }
 
 
     public List<MWSign> getSigns(Game game) {
     public List<MWSign> getSigns(Game game) {
-        return signs.stream().filter(s -> s.getLobby().equals(game.getLobby().getName())).collect(Collectors.toList());
+        return signs.stream().filter(s -> s.getLobby().equals(game.getGameConfig().getName())).collect(Collectors.toList());
     }
     }
 }
 }

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java

@@ -78,7 +78,7 @@ public class LobbyTimer extends Timer implements Runnable {
                 playPling();
                 playPling();
                 break;
                 break;
             case 10:
             case 10:
-                if (getGame().getLobby().getMapChooseProcedure() == MapChooseProcedure.MAPVOTING)
+                if (getGame().getGameConfig().getMapChooseProcedure() == MapChooseProcedure.MAPVOTING)
                     getGame().getMapVoting().setVotedArena();
                     getGame().getMapVoting().setVotedArena();
                 broadcast(PluginMessages.getMessage(true, PluginMessages.MessageEnum.LOBBY_TIMER_GAME_STARTS_IN)
                 broadcast(PluginMessages.getMessage(true, PluginMessages.MessageEnum.LOBBY_TIMER_GAME_STARTS_IN)
                         .replace("%seconds%", Integer.toString(seconds)));
                         .replace("%seconds%", Integer.toString(seconds)));

+ 3 - 3
missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java

@@ -158,7 +158,7 @@ public class PlayerListener implements Listener {
         if (!onJoinGame.isCancelled()) {
         if (!onJoinGame.isCancelled()) {
             game.updateGameInfo();
             game.updateGameInfo();
             logEventDebugMessage(player, game);
             logEventDebugMessage(player, game);
-            Logger.NORMAL.log(player.getName() + " joint the MW game " + game.getLobby().getName());
+            Logger.NORMAL.log(player.getName() + " joint the MW game " + game.getGameConfig().getName());
         } else {
         } else {
             Logger.DEBUG.log("Canceling game join for " + player.getName());
             Logger.DEBUG.log("Canceling game join for " + player.getName());
         }
         }
@@ -172,7 +172,7 @@ public class PlayerListener implements Listener {
 
 
         game.updateGameInfo();
         game.updateGameInfo();
         logEventDebugMessage(player, game);
         logEventDebugMessage(player, game);
-        Logger.NORMAL.log(player.getName() + " left the MW game " + game.getLobby().getName());
+        Logger.NORMAL.log(player.getName() + " left the MW game " + game.getGameConfig().getName());
 
 
         return onLeaveGame;
         return onLeaveGame;
     }
     }
@@ -196,7 +196,7 @@ public class PlayerListener implements Listener {
 
 
         Logger.DEBUG.log("Location: " + player.getLocation());
         Logger.DEBUG.log("Location: " + player.getLocation());
         Logger.DEBUG.log("Current game amount: " + GameManager.getInstance().getGameAmount());
         Logger.DEBUG.log("Current game amount: " + GameManager.getInstance().getGameAmount());
-        Logger.DEBUG.log("Lobby: " + game.getLobby().getDisplayName());
+        Logger.DEBUG.log("Lobby: " + game.getGameConfig().getDisplayName());
         Logger.DEBUG.log("Team 1: " + game.getTeamManager().getTeam1());
         Logger.DEBUG.log("Team 1: " + game.getTeamManager().getTeam1());
         Logger.DEBUG.log("Team 2: " + game.getTeamManager().getTeam2());
         Logger.DEBUG.log("Team 2: " + game.getTeamManager().getTeam2());
 
 

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java

@@ -113,8 +113,8 @@ public class EndListener extends GameBoundListener {
         
         
         Player player = event.getPlayer();
         Player player = event.getPlayer();
 
 
-        JoinIngameBehavior joinBehavior = getGame().getLobby().getJoinIngameBehavior();
-        RejoinIngameBehavior rejoinBehavior = getGame().getLobby().getRejoinIngameBehavior();
+        JoinIngameBehavior joinBehavior = getGame().getGameConfig().getJoinIngameBehavior();
+        RejoinIngameBehavior rejoinBehavior = getGame().getGameConfig().getRejoinIngameBehavior();
         boolean isKnownPlayer = getGame().getGameLeaveManager().isKnownPlayer(player.getUniqueId());
         boolean isKnownPlayer = getGame().getGameLeaveManager().isKnownPlayer(player.getUniqueId());
         Team lastTeam = getGame().getGameLeaveManager().getLastTeamOfKnownPlayer(player.getUniqueId());
         Team lastTeam = getGame().getGameLeaveManager().getLastTeamOfKnownPlayer(player.getUniqueId());
         
         

+ 2 - 2
missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java

@@ -327,8 +327,8 @@ public class GameListener extends GameBoundListener {
 
 
         Player player = event.getPlayer();
         Player player = event.getPlayer();
 
 
-        JoinIngameBehavior joinBehavior = getGame().getLobby().getJoinIngameBehavior();
-        RejoinIngameBehavior rejoinBehavior = getGame().getLobby().getRejoinIngameBehavior();
+        JoinIngameBehavior joinBehavior = getGame().getGameConfig().getJoinIngameBehavior();
+        RejoinIngameBehavior rejoinBehavior = getGame().getGameConfig().getRejoinIngameBehavior();
         boolean isKnownPlayer = getGame().getGameLeaveManager().isKnownPlayer(player.getUniqueId());
         boolean isKnownPlayer = getGame().getGameLeaveManager().isKnownPlayer(player.getUniqueId());
         Team lastTeam = getGame().getGameLeaveManager().getLastTeamOfKnownPlayer(player.getUniqueId());
         Team lastTeam = getGame().getGameLeaveManager().getLastTeamOfKnownPlayer(player.getUniqueId());
         
         

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java

@@ -102,7 +102,7 @@ public class LobbyListener extends GameBoundListener {
     public void onRespawn(PlayerRespawnEvent event) {
     public void onRespawn(PlayerRespawnEvent event) {
         if (!isInLobbyArea(event.getPlayer().getLocation())) return;
         if (!isInLobbyArea(event.getPlayer().getLocation())) return;
 
 
-        event.setRespawnLocation(getGame().getLobby().getSpawnPoint());
+        event.setRespawnLocation(getGame().getGameConfig().getSpawnPoint());
     }
     }
 
 
     @EventHandler
     @EventHandler

+ 4 - 5
missilewars-plugin/src/main/java/de/butzlabben/missilewars/menus/inventory/MapVoteMenu.java

@@ -8,7 +8,6 @@ import com.github.stefvanschie.inventoryframework.pane.component.PercentageBar;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
 import de.butzlabben.missilewars.menus.MenuItem;
 import de.butzlabben.missilewars.menus.MenuItem;
 import de.butzlabben.missilewars.menus.MenuUtils;
 import de.butzlabben.missilewars.menus.MenuUtils;
 import de.butzlabben.missilewars.player.MWPlayer;
 import de.butzlabben.missilewars.player.MWPlayer;
@@ -49,7 +48,7 @@ public class MapVoteMenu {
         MenuItem.setDisplayName(forwardsItemActive, Config.MapVoteMenuItems.FORWARDS_ITEM_ACTIVE.getMessage());
         MenuItem.setDisplayName(forwardsItemActive, Config.MapVoteMenuItems.FORWARDS_ITEM_ACTIVE.getMessage());
         MenuItem.setDisplayName(forwardsItemInactive, Config.MapVoteMenuItems.FORWARDS_ITEM_INACTIVE.getMessage());
         MenuItem.setDisplayName(forwardsItemInactive, Config.MapVoteMenuItems.FORWARDS_ITEM_INACTIVE.getMessage());
         
         
-        for (Arena arena : game.getLobby().getArenas()) {
+        for (Arena arena : game.getGameConfig().getArenas()) {
             arenaDisplayNames.put(arena.getDisplayName(), arena);
             arenaDisplayNames.put(arena.getDisplayName(), arena);
         }
         }
         
         
@@ -73,7 +72,7 @@ public class MapVoteMenu {
         backwards = new OutlinePane(3, 5, 1, 1);
         backwards = new OutlinePane(3, 5, 1, 1);
         forwards = new OutlinePane(5, 5, 1, 1);
         forwards = new OutlinePane(5, 5, 1, 1);
         
         
-        int maxPages = (int) Math.ceil(game.getLobby().getArenas().size() / 5d);
+        int maxPages = (int) Math.ceil(game.getGameConfig().getArenas().size() / 5d);
         int offset = 0;
         int offset = 0;
         for (int page = 1; page <= maxPages; page++) {
         for (int page = 1; page <= maxPages; page++) {
             
             
@@ -86,9 +85,9 @@ public class MapVoteMenu {
                 
                 
                 // Are there any other arenas?
                 // Are there any other arenas?
                 int nextArenaId = (offset * 5) + n - 1;
                 int nextArenaId = (offset * 5) + n - 1;
-                if (game.getLobby().getArenas().size() < (nextArenaId + 1)) break;
+                if (game.getGameConfig().getArenas().size() < (nextArenaId + 1)) break;
                 
                 
-                Arena arena = game.getLobby().getArenas().get(nextArenaId);
+                Arena arena = game.getGameConfig().getArenas().get(nextArenaId);
                 
                 
                 // arena item:
                 // arena item:
                 ItemStack item = new ItemStack(Material.valueOf(arena.getDisplayMaterial().toUpperCase()));
                 ItemStack item = new ItemStack(Material.valueOf(arena.getDisplayMaterial().toUpperCase()));