浏览代码

Refactoring, re-adding config update of lobby after loading

RedstoneFuture 2 年之前
父节点
当前提交
710f50d681

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

@@ -72,8 +72,7 @@ public class Arenas {
                     continue;
                 }
                 SetupUtil.checkMap(arena.getTemplateWorld());
-                // Save for possible new values
-                Serializer.serialize(config, arena);
+                arena.updateConfig();
                 arenas.add(arena);
             } catch (IOException exception) {
                 Logger.ERROR.log("Could not load config for arena " + config.getName());

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

@@ -150,6 +150,7 @@ public class GameManager {
         try {
             Lobby lobby = Serializer.deserialize(targetLobby.getFile(), Lobby.class);
             lobby.setFile(targetLobby.getFile());
+            lobby.updateConfig();
 
             Logger.BOOTDONE.log("Reloaded lobby \"" + targetLobbyName + "\" (" + targetLobby.getFile().getName() + ")");
             addGame(targetLobbyName, new Game(lobby));