Browse Source

Renaming `arena.class`

RedstoneFuture 5 months ago
parent
commit
78bbbf2a37
26 changed files with 169 additions and 169 deletions
  1. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommandCompletions.java
  2. 4 4
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java
  3. 19 19
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/SetupCommands.java
  4. 3 3
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java
  5. 4 4
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ArenaConfig.java
  6. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/game/GameConfig.java
  7. 11 11
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Arenas.java
  8. 28 28
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java
  9. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameLeaveManager.java
  10. 4 4
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameResultManager.java
  11. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameWorld.java
  12. 22 22
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/MapVoting.java
  13. 7 7
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/EquipmentManager.java
  14. 17 17
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/PlayerEquipmentRandomizer.java
  15. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/SchematicGameEquipment.java
  16. 4 4
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/SpecialGameEquipment.java
  17. 10 10
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java
  18. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java
  19. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/schematics/objects/Missile.java
  20. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java
  21. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/FightStats.java
  22. 1 1
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/GameTimer.java
  23. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java
  24. 2 2
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java
  25. 8 8
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java
  26. 10 10
      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

@@ -57,7 +57,7 @@ public class MWCommandCompletions {
             Game game = GameManager.getInstance().getGame(player.getLocation());
             if (game == null) return null;
 
-            return game.getArena().getMissileConfig().getSchematicNames();
+            return game.getArenaConfig().getMissileConfig().getSchematicNames();
         });
     }
     

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

@@ -95,8 +95,8 @@ public class MWCommands extends BaseCommand {
             
             sender.sendMessage("§8 - §f" + "Load with startup: §7" + game.getGameConfig().isAutoLoad());
             
-            sender.sendMessage("§8 - §f" + "Current Arena: §7" + ((game.getArena() != null) ? game.getArena().getName() : "?") 
-                    + "§7 -- Name: »" + ((game.getArena() != null) ? game.getArena().getDisplayName() : "?") + "§7«");
+            sender.sendMessage("§8 - §f" + "Current Arena: §7" + ((game.getArenaConfig() != null) ? game.getArenaConfig().getName() : "?") 
+                    + "§7 -- Name: »" + ((game.getArenaConfig() != null) ? game.getArenaConfig().getDisplayName() : "?") + "§7«");
             
             sender.sendMessage("§8 - §f" + "Total players: §7" + game.getTotalGameUserAmount() + "x");
             
@@ -236,7 +236,7 @@ public class MWCommands extends BaseCommand {
             return;
         }
 
-        Missile missile = (Missile) game.getArena().getMissileConfig().getSchematicFromFileName(args[0]);
+        Missile missile = (Missile) game.getArenaConfig().getMissileConfig().getSchematicFromFileName(args[0]);
         if (missile == null) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.COMMAND_INVALID_MISSILE)
                     .replace("%input%", args[0]));
@@ -438,7 +438,7 @@ public class MWCommands extends BaseCommand {
         int i = 0;
         Logger.NORMAL.log("Starting to print debug information for MissileWars v" + MissileWars.getInstance().version);
         for (Game game : GameManager.getInstance().getGames().values()) {
-            Logger.NORMAL.log("Printing state for arena " + game.getArena().getName() + ". Number: " + i);
+            Logger.NORMAL.log("Printing state for arena " + game.getArenaConfig().getName() + ". Number: " + i);
             Logger.NORMAL.log(game.toString());
         }
 

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

@@ -100,8 +100,8 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                game.getArena().setSpectatorSpawn(player.getLocation());
-                game.getArena().updateConfig();
+                game.getArenaConfig().setSpectatorSpawn(player.getLocation());
+                game.getArenaConfig().updateConfig();
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'spectatorSpawn' to " + player.getLocation() + ".");
             }
 
@@ -111,7 +111,7 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                player.teleport(game.getArena().getSpectatorSpawn());
+                player.teleport(game.getArenaConfig().getSpectatorSpawn());
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'spectatorSpawn'.");
             }
 
@@ -126,8 +126,8 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                game.getArena().setTeam1Spawn(player.getLocation());
-                game.getArena().updateConfig();
+                game.getArenaConfig().setTeam1Spawn(player.getLocation());
+                game.getArenaConfig().updateConfig();
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'team1Spawn' to " + player.getLocation() + ".");
             }
 
@@ -137,7 +137,7 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                player.teleport(game.getArena().getTeam1Spawn());
+                player.teleport(game.getArenaConfig().getTeam1Spawn());
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'team1Spawn'.");
             }
 
@@ -152,8 +152,8 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                game.getArena().setTeam2Spawn(player.getLocation());
-                game.getArena().updateConfig();
+                game.getArenaConfig().setTeam2Spawn(player.getLocation());
+                game.getArenaConfig().updateConfig();
                 player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'team2Spawn' to " + player.getLocation() + ".");
             }
 
@@ -163,7 +163,7 @@ public class SetupCommands extends BaseCommand {
                 if (!senderIsPlayer(sender)) return;
                 if (!isValidGame(args)) return;
 
-                player.teleport(game.getArena().getTeam2Spawn());
+                player.teleport(game.getArenaConfig().getTeam2Spawn());
                 player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'team2Spawn'.");
             }
 
@@ -181,9 +181,9 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
 
-                    game.getArena().getArea().setPosition1(player.getLocation());
-                    game.getArena().setAreaConfig(game.getArena().getArea().getAreaConfiguration());
-                    game.getArena().updateConfig();
+                    game.getArenaConfig().getArea().setPosition1(player.getLocation());
+                    game.getArenaConfig().setAreaConfig(game.getArenaConfig().getArea().getAreaConfiguration());
+                    game.getArenaConfig().updateConfig();
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'arena area' (position 1) to " + player.getLocation() + ".");
                 }
 
@@ -193,8 +193,8 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
 
-                    player.teleport(game.getArena().getArea().getPosition1());
-                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'arena area' (position 1): " + game.getArena().getArea().getPosition1().toString());
+                    player.teleport(game.getArenaConfig().getArea().getPosition1());
+                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'arena area' (position 1): " + game.getArenaConfig().getArea().getPosition1().toString());
                 }
 
             }
@@ -208,9 +208,9 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
 
-                    game.getArena().getArea().setPosition2(player.getLocation());
-                    game.getArena().setAreaConfig(game.getArena().getArea().getAreaConfiguration());
-                    game.getArena().updateConfig();
+                    game.getArenaConfig().getArea().setPosition2(player.getLocation());
+                    game.getArenaConfig().setAreaConfig(game.getArenaConfig().getArea().getAreaConfiguration());
+                    game.getArenaConfig().updateConfig();
                     player.sendMessage(PluginMessages.getPrefix() + "§fSet new 'arena area' (position 2) to " + player.getLocation() + ".");
                 }
 
@@ -220,8 +220,8 @@ public class SetupCommands extends BaseCommand {
                     if (!senderIsPlayer(sender)) return;
                     if (!isValidGame(args)) return;
 
-                    player.teleport(game.getArena().getArea().getPosition2());
-                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'arena area' (position 2): " + game.getArena().getArea().getPosition2().toString());
+                    player.teleport(game.getArenaConfig().getArea().getPosition2());
+                    player.sendMessage(PluginMessages.getPrefix() + "§fTeleported to 'arena area' (position 2): " + game.getArenaConfig().getArea().getPosition2().toString());
                 }
 
             }

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

@@ -132,8 +132,8 @@ public class UserCommands extends BaseCommand {
         MWPlayer mwPlayer = game.getPlayer(player);
         
         if (game.getState() == GameState.LOBBY) {
-            if (game.getArena() != null) {
-                if (!game.getArena().isTeamchangeOngoingGame()) {
+            if (game.getArenaConfig() != null) {
+                if (!game.getArenaConfig().isTeamchangeOngoingGame()) {
                     // Is too late for team change (last seconds of lobby waiting-time)?
                     if (game.getTaskManager().getTimer().getSeconds() < 10) {
                         player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.TEAM_CHANGE_TEAM_NO_LONGER_NOW));
@@ -144,7 +144,7 @@ public class UserCommands extends BaseCommand {
             
         } else if (game.getState() == GameState.INGAME) {
             // Is team change only in lobby allowed?
-            if (!game.getArena().isTeamchangeOngoingGame()) {
+            if (!game.getArenaConfig().isTeamchangeOngoingGame()) {
                 player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.TEAM_CHANGE_TEAM_NOT_NOW));
                 return;
             }

+ 4 - 4
missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/Arena.java → missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ArenaConfig.java

@@ -32,7 +32,7 @@ import java.io.IOException;
 
 @Getter
 @ToString
-public class Arena implements Cloneable {
+public class ArenaConfig implements Cloneable {
 
     // The values defined here are only valid if there is no Config yet.
     private String name = "arena0";
@@ -74,14 +74,14 @@ public class Arena implements Cloneable {
     @Setter private transient GameArea area;
     @Setter private transient File file;
 
-    public Arena() {
+    public ArenaConfig() {
 
     }
     
     @Override
-    public Arena clone() {
+    public ArenaConfig clone() {
         try {
-            Arena clone = (Arena) super.clone();
+            ArenaConfig clone = (ArenaConfig) super.clone();
             clone.spectatorSpawn = spectatorSpawn.clone();
             clone.team1Spawn = team1Spawn.clone();
             clone.team2Spawn = team2Spawn.clone();

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

@@ -22,7 +22,7 @@ import com.google.gson.annotations.SerializedName;
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.arena.modules.AreaConfig;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.game.Arenas;
 import de.butzlabben.missilewars.game.enums.JoinIngameBehavior;
 import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
@@ -87,7 +87,7 @@ public class GameConfig {
         return Bukkit.getWorlds().get(0);
     }
 
-    public List<Arena> getArenas() {
+    public List<ArenaConfig> getArenas() {
         return possibleArenas
                 .stream()
                 .map(Arenas::getFromName)

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

@@ -21,7 +21,7 @@ package de.butzlabben.missilewars.game;
 import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.configuration.Config;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.util.SetupUtil;
 import de.butzlabben.missilewars.util.serialization.Serializer;
 import lombok.Getter;
@@ -35,7 +35,7 @@ import java.util.Map;
 public class Arenas {
 
     @Getter
-    private static final Map<String, Arena> ARENAS = new HashMap<>();
+    private static final Map<String, ArenaConfig> ARENAS = new HashMap<>();
 
     public static void load() {
         ARENAS.clear();
@@ -51,7 +51,7 @@ public class Arenas {
             File defaultArena = new File(folder, "arena0.yml");
             try {
                 defaultArena.createNewFile();
-                Serializer.serialize(defaultArena, new Arena());
+                Serializer.serialize(defaultArena, new ArenaConfig());
             } catch (IOException exception) {
                 Logger.ERROR.log("Could not create default arena config");
                 Logger.ERROR.log("As there are no arenas present, the plugin is shutting down");
@@ -65,16 +65,16 @@ public class Arenas {
         for (File config : files) {
             if (!config.getName().endsWith(".yml") && !config.getName().endsWith(".yaml")) continue;
             try {
-                Arena arena = Serializer.deserialize(config, Arena.class);
-                arena.setFile(config);
-                if (existsArena(arena.getName())) {
-                    Logger.WARN.log("There are several arenas configured with the name \"" + arena.getName() + "\". Arenas must have a unique name");
+                ArenaConfig arenaConfig = Serializer.deserialize(config, ArenaConfig.class);
+                arenaConfig.setFile(config);
+                if (existsArena(arenaConfig.getName())) {
+                    Logger.WARN.log("There are several arenas configured with the name \"" + arenaConfig.getName() + "\". Arenas must have a unique name");
                     continue;
                 }
-                SetupUtil.saveDefaultFiles(Config.getArenasFolder() + File.separator + arena.getTemplateWorld(), 
+                SetupUtil.saveDefaultFiles(Config.getArenasFolder() + File.separator + arenaConfig.getTemplateWorld(), 
                         "MissileWars-Arena.zip", MissileWars.getInstance());
-                arena.updateConfig();
-                ARENAS.put(arena.getName(), arena);
+                arenaConfig.updateConfig();
+                ARENAS.put(arenaConfig.getName(), arenaConfig);
             } catch (IOException exception) {
                 Logger.ERROR.log("Could not load config for arena " + config.getName());
                 exception.printStackTrace();
@@ -82,7 +82,7 @@ public class Arenas {
         }
     }
 
-    public static Arena getFromName(String arenaName) {
+    public static ArenaConfig getFromName(String arenaName) {
         if (ARENAS.containsKey(arenaName)) return ARENAS.get(arenaName);
         return null;
     }

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

@@ -22,7 +22,7 @@ import de.butzlabben.missilewars.Logger;
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.PluginMessages;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.configuration.game.GameConfig;
 import de.butzlabben.missilewars.event.GameStartEvent;
 import de.butzlabben.missilewars.event.GameStopEvent;
@@ -90,7 +90,7 @@ public class Game {
     private GameArea gameArea;
     private GameArea innerGameArea;
     private long timestart;
-    private Arena arena;
+    private ArenaConfig arenaConfig;
     private ScoreboardManager scoreboardManager;
     private GameJoinManager gameJoinManager;
     private GameLeaveManager gameLeaveManager;
@@ -154,20 +154,20 @@ public class Game {
         
         // choose the game arena
         if (gameConfig.getMapChooseProcedure() == MapChooseProcedure.FIRST) {
-            setArena(gameConfig.getArenas().get(0));
+            setArenaConfig(gameConfig.getArenas().get(0));
             prepareGame();
 
         } 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;
+            List<ArenaConfig> arenaConfigs = gameConfig.getArenas();
+            int index = lastMapIndex >= arenaConfigs.size() - 1 ? 0 : lastMapIndex + 1;
             cycles.put(gameConfig.getName(), index);
-            setArena(arenas.get(index));
+            setArenaConfig(arenaConfigs.get(index));
             prepareGame();
 
         } else if (gameConfig.getMapChooseProcedure() == MapChooseProcedure.MAPVOTING) {
             if (mapVoting.onlyOneArenaFound()) {
-                setArena(gameConfig.getArenas().get(0));
+                setArenaConfig(gameConfig.getArenas().get(0));
                 Logger.WARN.log("Only one arena was found for the lobby \"" + gameConfig.getName() + "\". The configured map voting was skipped.");
                 prepareGame();
             } else {
@@ -185,7 +185,7 @@ public class Game {
      * now already defined.
      */
     public void prepareGame() {
-        if (this.arena == null) {
+        if (this.arenaConfig == null) {
             throw new IllegalStateException("The arena is not yet set");
         }
         
@@ -232,7 +232,7 @@ public class Game {
         World world = gameWorld.getWorld();
 
         if (world == null) {
-            Logger.ERROR.log("Could not start game in arena \"" + arena.getName() + "\". World is null");
+            Logger.ERROR.log("Could not start game in arena \"" + arenaConfig.getName() + "\". World is null");
             return;
         }
 
@@ -280,7 +280,7 @@ public class Game {
 
         updateMOTD();
 
-        if (arena.isSaveStatistics()) {
+        if (arenaConfig.isSaveStatistics()) {
             FightStats stats = new FightStats(this);
             stats.insert();
         }
@@ -457,7 +457,7 @@ public class Game {
     public void spawnMissile(Player player, ItemStack itemStack) {
 
         // Are missiles only allowed to spawn inside the arena, between the two arena spawn points?
-        boolean isOnlyBetweenSpawnPlaceable = this.arena.getMissileConfig().isOnlyBetweenSpawnPlaceable();
+        boolean isOnlyBetweenSpawnPlaceable = this.arenaConfig.getMissileConfig().isOnlyBetweenSpawnPlaceable();
         if (isOnlyBetweenSpawnPlaceable) {
             if (!isInInnerGameArea(player.getLocation())) {
                 player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.ARENA_MISSILE_PLACE_DENY));
@@ -468,7 +468,7 @@ public class Game {
         ItemMeta itemMeta = itemStack.getItemMeta();
         if (itemMeta == null) return;
         
-        Missile missile = (Missile) this.arena.getMissileConfig().getSchematicFromDisplayName(itemMeta.getDisplayName());
+        Missile missile = (Missile) this.arenaConfig.getMissileConfig().getSchematicFromDisplayName(itemMeta.getDisplayName());
         if (missile == null) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.COMMAND_INVALID_MISSILE)
                     .replace("%input%", itemMeta.getDisplayName()));
@@ -491,7 +491,7 @@ public class Game {
         ItemMeta itemMeta = ball.getItem().getItemMeta();
         if (itemMeta == null) return;
 
-        Shield shield = (Shield) this.arena.getShieldConfig().getSchematicFromDisplayName(itemMeta.getDisplayName());
+        Shield shield = (Shield) this.arenaConfig.getShieldConfig().getSchematicFromDisplayName(itemMeta.getDisplayName());
         if (shield == null) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.COMMAND_INVALID_SHIELD)
                     .replace("%input%", itemMeta.getDisplayName()));
@@ -520,26 +520,26 @@ public class Game {
         fb.setBounce(false);
     }
 
-    public void setArena(Arena arena) {
-        if (this.arena != null) {
+    public void setArenaConfig(ArenaConfig arenaConfig) {
+        if (this.arenaConfig != null) {
             throw new IllegalStateException("Arena already set");
         }
 
-        arena.getMissileConfig().check();
-        arena.getShieldConfig().check();
+        arenaConfig.getMissileConfig().check();
+        arenaConfig.getShieldConfig().check();
 
-        this.arena = arena.clone();
-        gameWorld = new GameWorld(this, arena.getTemplateWorld());
+        this.arenaConfig = arenaConfig.clone();
+        gameWorld = new GameWorld(this, arenaConfig.getTemplateWorld());
         gameWorld.load();
-        gameArea = new GameArea(gameWorld.getWorld(), arena.getAreaConfig());
+        gameArea = new GameArea(gameWorld.getWorld(), arenaConfig.getAreaConfig());
 
         try {
-            Serializer.setWorldAtAllLocations(this.arena, gameWorld.getWorld());
-            teamManager.getTeam1().setSpawn(this.arena.getTeam1Spawn());
-            teamManager.getTeam2().setSpawn(this.arena.getTeam2Spawn());
-            teamManager.getTeamSpec().setSpawn(this.arena.getSpectatorSpawn());
+            Serializer.setWorldAtAllLocations(this.arenaConfig, gameWorld.getWorld());
+            teamManager.getTeam1().setSpawn(this.arenaConfig.getTeam1Spawn());
+            teamManager.getTeam2().setSpawn(this.arenaConfig.getTeam2Spawn());
+            teamManager.getTeamSpec().setSpawn(this.arenaConfig.getSpectatorSpawn());
         } catch (Exception exception) {
-            Logger.ERROR.log("Could not inject world object at arena " + this.arena.getName());
+            Logger.ERROR.log("Could not inject world object at arena " + this.arenaConfig.getName());
             exception.printStackTrace();
             return;
         }
@@ -692,11 +692,11 @@ public class Game {
     
     public int getGameDuration() {
         int time = 0;
-        if (arena == null) return time;
+        if (arenaConfig == null) return time;
         
         if (state == GameState.LOBBY) {
             // Show the planned duration of the next game:
-            time = arena.getGameDuration();
+            time = arenaConfig.getGameDuration();
         } else if (state == GameState.INGAME) {
             // Show the remaining duration of the running game:
             time = getTaskManager().getTimer().getSeconds() / 60;
@@ -740,7 +740,7 @@ public class Game {
     }
 
     public void teleportToArenaSpectatorSpawn(Player player) {
-        Teleport.teleportSafely(player, arena.getSpectatorSpawn());
+        Teleport.teleportSafely(player, arenaConfig.getSpectatorSpawn());
     }
 
     public void teleportToAfterGameSpawn(Player player) {

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

@@ -79,7 +79,7 @@ public class GameLeaveManager {
         if (game.getState() == GameState.LOBBY) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.LOBBY_LEFT).replace("%lobby_name%", game.getGameConfig().getDisplayName()));
         } 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.getArenaConfig().getDisplayName()));
         }
 
     }

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

@@ -61,13 +61,13 @@ public class GameResultManager {
 
         switch (mwPlayer.getTeam().getGameResult()) {
             case WIN:
-                money = game.getArena().getMoney().getWin();
+                money = game.getArenaConfig().getMoney().getWin();
                 break;
             case LOSE:
-                money = game.getArena().getMoney().getLoss();
+                money = game.getArenaConfig().getMoney().getLoss();
                 break;
             case DRAW:
-                money = game.getArena().getMoney().getDraw();
+                money = game.getArenaConfig().getMoney().getDraw();
                 break;
             default:
                 money = 0;
@@ -175,7 +175,7 @@ public class GameResultManager {
             
         }
         
-        Firework firework = game.getGameWorld().getWorld().spawn(game.getArena().getSpectatorSpawn(), Firework.class);
+        Firework firework = game.getGameWorld().getWorld().spawn(game.getArenaConfig().getSpectatorSpawn(), Firework.class);
         FireworkMeta fireworkMeta = firework.getFireworkMeta();
         
         fireworkMeta.clearEffects();

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

@@ -126,8 +126,8 @@ public class GameWorld {
             World world = Bukkit.createWorld(new WorldCreator(worldName));
             Bukkit.getWorlds().add(world);
 
-            world.setGameRule(GameRule.DO_TILE_DROPS, game.getArena().isDoTileDrops());
-            world.setGameRule(GameRule.KEEP_INVENTORY, game.getArena().isKeepInventory());
+            world.setGameRule(GameRule.DO_TILE_DROPS, game.getArenaConfig().isDoTileDrops());
+            world.setGameRule(GameRule.KEEP_INVENTORY, game.getArenaConfig().isKeepInventory());
         }
     }
 

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

@@ -19,7 +19,7 @@
 package de.butzlabben.missilewars.game;
 
 import de.butzlabben.missilewars.configuration.PluginMessages;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
 import de.butzlabben.missilewars.game.enums.VoteState;
 import de.butzlabben.missilewars.player.MWPlayer;
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
 
 public class MapVoting {
 
-    private final Map<MWPlayer, Arena> arenaVotes = new HashMap<>();
+    private final Map<MWPlayer, ArenaConfig> arenaVotes = new HashMap<>();
     private Game game;
     @Getter private VoteState state = VoteState.NULL;
 
@@ -59,14 +59,14 @@ public class MapVoting {
             return;
         }
 
-        Arena arena = Arenas.getFromName(arenaName);
-        if (arena == null) {
+        ArenaConfig arenaConfig = Arenas.getFromName(arenaName);
+        if (arenaConfig == null) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.COMMAND_INVALID_MAP)
                     .replace("%input%", arenaName));
             return;
         }
         
-        if (!game.getGameConfig().getArenas().contains(arena)) {
+        if (!game.getGameConfig().getArenas().contains(arenaConfig)) {
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_MAP_NOT_AVAILABLE));
             return;
         }
@@ -75,9 +75,9 @@ public class MapVoting {
 
         if (arenaVotes.containsKey(mwPlayer)) {
 
-            if (arenaVotes.get(mwPlayer) == arena) {
+            if (arenaVotes.get(mwPlayer) == arenaConfig) {
                 player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_ARENA_ALREADY_SELECTED)
-                        .replace("%map%", arena.getDisplayName()));
+                        .replace("%map%", arenaConfig.getDisplayName()));
                 return;
             }
 
@@ -86,9 +86,9 @@ public class MapVoting {
         }
 
         // add the new vote
-        arenaVotes.put(mwPlayer, arena);
+        arenaVotes.put(mwPlayer, arenaConfig);
 
-        player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_SUCCESS).replace("%map%", arena.getDisplayName()));
+        player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_SUCCESS).replace("%map%", arenaConfig.getDisplayName()));
     }
 
     /**
@@ -96,27 +96,27 @@ public class MapVoting {
      *
      * @return (Arena) the winner arena for this vote
      */
-    private Arena getVotedArena() {
+    private ArenaConfig getVotedArena() {
 
         // If no one voted:
         if (arenaVotes.isEmpty()) return game.getGameConfig().getArenas().get(0);
 
-        Arena arena = arenaVotes.values().stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
+        ArenaConfig arenaConfig = arenaVotes.values().stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
                 .entrySet()
                 .stream()
                 .max(Map.Entry.comparingByValue()).orElseThrow()
                 .getKey();
 
-        return arena;
+        return arenaConfig;
     }
     
-    public double getPercentOf(Arena arena) {
-        long votes = arenaVotes.values().stream().filter(a -> a.equals(arena)).count();
+    public double getPercentOf(ArenaConfig arenaConfig) {
+        long votes = arenaVotes.values().stream().filter(a -> a.equals(arenaConfig)).count();
         return ((double) votes / arenaVotes.size()) * 100;
     }
     
-    public String getPercentOfMsg(Arena arena) {
-        double result = Math.round(getPercentOf(arena));
+    public String getPercentOfMsg(ArenaConfig arenaConfig) {
+        double result = Math.round(getPercentOf(arenaConfig));
         return Double.toString(result);
     }
     
@@ -162,18 +162,18 @@ public class MapVoting {
 
         stopVote();
 
-        Arena arena = game.getMapVoting().getVotedArena();
-        if (arena == null) throw new IllegalStateException("Voted arena is not present");
-        game.setArena(arena);
+        ArenaConfig arenaConfig = game.getMapVoting().getVotedArena();
+        if (arenaConfig == null) throw new IllegalStateException("Voted arena is not present");
+        game.setArenaConfig(arenaConfig);
 
         game.broadcast(PluginMessages.getMessage(true, PluginMessages.MessageEnum.VOTE_FINISHED)
-                .replace("%map%", game.getArena().getDisplayName()));
+                .replace("%map%", game.getArenaConfig().getDisplayName()));
 
         game.prepareGame();
     }
     
-    public boolean isVotedMapOfPlayer(Arena arena, MWPlayer mwPlayer) {
-        return (arenaVotes.get(mwPlayer) == arena);
+    public boolean isVotedMapOfPlayer(ArenaConfig arenaConfig, MWPlayer mwPlayer) {
+        return (arenaVotes.get(mwPlayer) == arenaConfig);
     }
     
 }

+ 7 - 7
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/EquipmentManager.java

@@ -58,7 +58,7 @@ public class EquipmentManager {
     public void createGameItems() {
 
         // Will it be used?
-        if (game.getArena().getSpawn().isSendBow() || game.getArena().getRespawn().isSendBow()) {
+        if (game.getArenaConfig().getSpawn().isSendBow() || game.getArenaConfig().getRespawn().isSendBow()) {
 
             ItemStack bow = new ItemStack(Material.BOW);
             bow.addEnchantment(Enchantment.ARROW_FIRE, 1);
@@ -72,7 +72,7 @@ public class EquipmentManager {
         }
 
         // Will it be used?
-        if (game.getArena().getSpawn().isSendPickaxe() || game.getArena().getRespawn().isSendPickaxe()) {
+        if (game.getArenaConfig().getSpawn().isSendPickaxe() || game.getArenaConfig().getRespawn().isSendPickaxe()) {
 
             ItemStack pickaxe = new ItemStack(Material.IRON_PICKAXE);
             ItemMeta pickaxeMeta = pickaxe.getItemMeta();
@@ -93,7 +93,7 @@ public class EquipmentManager {
     public void sendGameItems(Player player, boolean isRespawn) {
 
         if (isRespawn) {
-            if (game.getArena().isKeepInventory()) return;
+            if (game.getArenaConfig().isKeepInventory()) return;
 
         } else {
             // clear inventory
@@ -107,13 +107,13 @@ public class EquipmentManager {
         // send kit items
         if (isRespawn) {
 
-            if (game.getArena().getRespawn().isSendBow()) player.getInventory().addItem(this.customBow);
-            if (game.getArena().getRespawn().isSendPickaxe()) player.getInventory().addItem(this.customPickaxe);
+            if (game.getArenaConfig().getRespawn().isSendBow()) player.getInventory().addItem(this.customBow);
+            if (game.getArenaConfig().getRespawn().isSendPickaxe()) player.getInventory().addItem(this.customPickaxe);
 
         } else {
 
-            if (game.getArena().getSpawn().isSendBow()) player.getInventory().addItem(this.customBow);
-            if (game.getArena().getSpawn().isSendPickaxe()) player.getInventory().addItem(this.customPickaxe);
+            if (game.getArenaConfig().getSpawn().isSendBow()) player.getInventory().addItem(this.customBow);
+            if (game.getArenaConfig().getSpawn().isSendPickaxe()) player.getInventory().addItem(this.customPickaxe);
 
         }
     }

+ 17 - 17
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/PlayerEquipmentRandomizer.java

@@ -19,7 +19,7 @@
 package de.butzlabben.missilewars.game.equipment;
 
 import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.schematics.objects.Missile;
 import de.butzlabben.missilewars.game.schematics.objects.Shield;
@@ -37,7 +37,7 @@ public class PlayerEquipmentRandomizer {
 
     private final MWPlayer mwPlayer;
     private final Game game;
-    private final Arena arena;
+    private final ArenaConfig arenaConfig;
     private final EquipmentManager equipmentManager;
 
     private final int maxGameDuration;
@@ -55,13 +55,13 @@ public class PlayerEquipmentRandomizer {
     public PlayerEquipmentRandomizer(MWPlayer mwPlayer, Game game) {
         this.mwPlayer = mwPlayer;
         this.game = game;
-        this.arena = game.getArena();
+        this.arenaConfig = game.getArenaConfig();
         this.equipmentManager = game.getEquipmentManager();
         randomizer = new Random();
-        maxGameDuration = game.getArena().getGameDuration() * 60;
+        maxGameDuration = game.getArenaConfig().getGameDuration() * 60;
         
-        this.startInterval = arena.getInterval().getCustomStartInterval();
-        this.respawnInterval = arena.getInterval().getCustomRespawnInterval();
+        this.startInterval = arenaConfig.getInterval().getCustomStartInterval();
+        this.respawnInterval = arenaConfig.getInterval().getCustomRespawnInterval();
 
         initializePlayerInterval();
     }
@@ -99,7 +99,7 @@ public class PlayerEquipmentRandomizer {
      */
     public void resetPlayerInterval() {
         // config option 'resetAfterRespawn'
-        if (!arena.getInterval().isResetAfterRespawn()) return;
+        if (!arenaConfig.getInterval().isResetAfterRespawn()) return;
         
         // adding 1 value before setting the player interval because of the timing
         if (respawnInterval == -1) {
@@ -187,19 +187,19 @@ public class PlayerEquipmentRandomizer {
      */
     private int getIntervalByTeamAmount() {
 
-        if (arena.getInterval().getIntervalsByTeamAmount().isEmpty()) {
-            Logger.WARN.log("The given interval mapping in \"" + arena.getName() + "\" is empty. Choosing default value " + DEFAULT_INTERVAL_BY_TEAM_AMOUNT + ".");
+        if (arenaConfig.getInterval().getIntervalsByTeamAmount().isEmpty()) {
+            Logger.WARN.log("The given interval mapping in \"" + arenaConfig.getName() + "\" is empty. Choosing default value " + DEFAULT_INTERVAL_BY_TEAM_AMOUNT + ".");
             return DEFAULT_INTERVAL_BY_TEAM_AMOUNT;
         }
 
         int teamSize = mwPlayer.getTeam().getMembers().size();
         for (int i = teamSize; i > 0; i--) {
-            if (arena.getInterval().getIntervalsByTeamAmount().containsKey(Integer.toString(i))) {
-                return arena.getInterval().getIntervalsByTeamAmount().get(Integer.toString(i));
+            if (arenaConfig.getInterval().getIntervalsByTeamAmount().containsKey(Integer.toString(i))) {
+                return arenaConfig.getInterval().getIntervalsByTeamAmount().get(Integer.toString(i));
             }
         }
 
-        Logger.DEBUG.log("No interval value for map \"" + arena.getName() + "\" could be detected based on the team amount of " + teamSize + ". Please define at least one a interval value for a minimal team amount of 1.");
+        Logger.DEBUG.log("No interval value for map \"" + arenaConfig.getName() + "\" could be detected based on the team amount of " + teamSize + ". Please define at least one a interval value for a minimal team amount of 1.");
         return DEFAULT_INTERVAL_BY_TEAM_AMOUNT;
     }
 
@@ -212,19 +212,19 @@ public class PlayerEquipmentRandomizer {
      */
     private double getFactorByGameTime() {
 
-        if (arena.getInterval().getIntervalFactorByGameTime().isEmpty()) {
-            Logger.WARN.log("The given interval factor mapping in \"" + arena.getName() + "\" is empty. Choosing default value " + DEFAULT_FACTOR_BY_GAME_TIME + ".");
+        if (arenaConfig.getInterval().getIntervalFactorByGameTime().isEmpty()) {
+            Logger.WARN.log("The given interval factor mapping in \"" + arenaConfig.getName() + "\" is empty. Choosing default value " + DEFAULT_FACTOR_BY_GAME_TIME + ".");
             return DEFAULT_FACTOR_BY_GAME_TIME;
         }
 
         int seconds = game.getTaskManager().getTimer().getSeconds();
         for (int i = seconds; i <= maxGameDuration; i++) {
-            if (arena.getInterval().getIntervalFactorByGameTime().containsKey(Integer.toString(i))) {
-                return arena.getInterval().getIntervalFactorByGameTime().get(Integer.toString(i));
+            if (arenaConfig.getInterval().getIntervalFactorByGameTime().containsKey(Integer.toString(i))) {
+                return arenaConfig.getInterval().getIntervalFactorByGameTime().get(Integer.toString(i));
             }
         }
 
-        Logger.DEBUG.log("No interval factor value for map \"" + arena.getName() + "\" could be detected based on the game time of " + seconds + " seconds. Please define at least one a interval value for a minimal team amount of " + maxGameDuration + " seconds.");
+        Logger.DEBUG.log("No interval factor value for map \"" + arenaConfig.getName() + "\" could be detected based on the game time of " + seconds + " seconds. Please define at least one a interval value for a minimal team amount of " + maxGameDuration + " seconds.");
         return DEFAULT_FACTOR_BY_GAME_TIME;
     }
 

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

@@ -52,13 +52,13 @@ public class SchematicGameEquipment {
     private void createSchematicEquipmentList(SchematicObject.schematicType schematicType) {
 
         if (schematicType == SchematicObject.schematicType.MISSILE) {
-            for (SchematicObject object : game.getArena().getMissileConfig().getSchematics()) {
+            for (SchematicObject object : game.getArenaConfig().getMissileConfig().getSchematics()) {
                 for (int i = object.getOccurrence(); i > 0; i--) {
                     schematicEquipmentList.add(object);
                 }
             }
         } else if (schematicType == SchematicObject.schematicType.SHIELD) {
-            for (SchematicObject object : game.getArena().getShieldConfig().getSchematics()) {
+            for (SchematicObject object : game.getArenaConfig().getShieldConfig().getSchematics()) {
                 for (int i = object.getOccurrence(); i > 0; i--) {
                     schematicEquipmentList.add(object);
                 }

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

@@ -60,8 +60,8 @@ public class SpecialGameEquipment {
      */
     private void createSpecialEquipmentList() {
         
-        int arrowOccurrence = game.getArena().getArrowConfig().getOccurrence();
-        int fireballOccurrence = game.getArena().getFireballConfig().getOccurrence();
+        int arrowOccurrence = game.getArenaConfig().getArrowConfig().getOccurrence();
+        int fireballOccurrence = game.getArenaConfig().getFireballConfig().getOccurrence();
 
         for (int i = arrowOccurrence; i > 0; i--) {
             specialEquipmentList.add(arrow);
@@ -77,7 +77,7 @@ public class SpecialGameEquipment {
      * This method creates the arrow item stack.
      */
     private void createArrow() {
-        arrow = new ItemStack(Material.ARROW, game.getArena().getArrowConfig().getAmount());
+        arrow = new ItemStack(Material.ARROW, game.getArenaConfig().getArrowConfig().getAmount());
     }
 
     /**
@@ -86,7 +86,7 @@ public class SpecialGameEquipment {
     private void createFireball() {
         fireball = new ItemStack(Material.FIRE_CHARGE);
         ItemMeta fireballMeta = fireball.getItemMeta();
-        fireballMeta.setDisplayName(game.getArena().getFireballConfig().getName());
+        fireballMeta.setDisplayName(game.getArenaConfig().getFireballConfig().getName());
         fireball.setItemMeta(fireballMeta);
     }
 

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

@@ -20,7 +20,7 @@ package de.butzlabben.missilewars.game.misc;
 
 import de.butzlabben.missilewars.MissileWars;
 import de.butzlabben.missilewars.configuration.game.GameConfig;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.game.GameManager;
 import de.butzlabben.missilewars.game.enums.GameState;
@@ -88,13 +88,13 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
                 if (params.startsWith("player_")) return noInformation;
             }
             
-            if (playerGame.getArena() == null) {
+            if (playerGame.getArenaConfig() == null) {
                 // if (params.startsWith("arena_")) return "§c§oThis is not a game arena!";
                 if (params.startsWith("arena_")) return noInformation;
             }
 
             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.getArenaConfig().getName());
             
         }
         
@@ -173,21 +173,21 @@ public class MissileWarsPlaceholder extends PlaceholderExpansion {
                 }
             }
             
-            for (Arena arena : gameConfig.getArenas()) {
+            for (ArenaConfig arenaConfig : gameConfig.getArenas()) {
 
                 // %missilewars_arena_displayname_<arena name or 'this'>%
-                if (params.equalsIgnoreCase("arena_displayname_" + arena.getName())) {
-                    return arena.getDisplayName();
+                if (params.equalsIgnoreCase("arena_displayname_" + arenaConfig.getName())) {
+                    return arenaConfig.getDisplayName();
                 }
 
                 // %missilewars_arena_missileamount_<arena name or 'this'>%
-                if (params.equalsIgnoreCase("arena_missileamount_" + arena.getName())) {
-                    return Integer.toString(arena.getMissileConfig().getSchematics().size());
+                if (params.equalsIgnoreCase("arena_missileamount_" + arenaConfig.getName())) {
+                    return Integer.toString(arenaConfig.getMissileConfig().getSchematics().size());
                 }
                 
                 // %missilewars_arena_gameduration_<arena name or 'this'>%
-                if (params.equalsIgnoreCase("arena_gameduration_" + arena.getName())) {
-                    return Integer.toString(arena.getGameDuration());
+                if (params.equalsIgnoreCase("arena_gameduration_" + arenaConfig.getName())) {
+                    return Integer.toString(arenaConfig.getGameDuration());
                 }
                 
             }

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

@@ -69,11 +69,11 @@ public class ScoreboardManager {
         team1 = game.getTeamManager().getTeam1();
         team2 = game.getTeamManager().getTeam2();
 
-        if (game.getArena() == null) {
+        if (game.getArenaConfig() == null) {
             // using of placeholders until the arena is not set
             setArenaDisplayName("?");
         } else {
-            setArenaDisplayName(game.getArena().getDisplayName());
+            setArenaDisplayName(game.getArenaConfig().getDisplayName());
         }
 
         // register Scoreboard

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/schematics/objects/Missile.java

@@ -69,7 +69,7 @@ public class Missile extends SchematicObject {
     public void paste(Game game, Player player, boolean hasTempBlock, Material tempBlockMaterial, int tempBlockDelay, 
                       int tempBlockRadius) {
         
-        SchematicFacing schematicFacing = SchematicFacing.getFacingPlayer(player, game.getArena().getMissileConfig());
+        SchematicFacing schematicFacing = SchematicFacing.getFacingPlayer(player, game.getArenaConfig().getMissileConfig());
         if (schematicFacing == null) return;
         
         try {

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

@@ -99,7 +99,7 @@ public class MWSign {
                     break;
                 case INGAME:
                 case END:
-                    name = game.getArena().getDisplayName();
+                    name = game.getArenaConfig().getDisplayName();
                     break;
             }
         }

+ 1 - 1
missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/FightStats.java

@@ -41,7 +41,7 @@ public class FightStats {
     public FightStats(Game game) {
         this.game = game;
 
-        arenaName = game.getArena().getName();
+        arenaName = game.getArenaConfig().getName();
         timeStart = game.getTimestart();
         timeElapsed = System.currentTimeMillis() - timeStart;
         teamWon = getGameResultCode();

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

@@ -36,7 +36,7 @@ public class GameTimer extends Timer {
     
     public GameTimer(Game game) {
         super(game);
-        seconds = game.getArena().getGameDuration() * 60;
+        seconds = game.getArenaConfig().getGameDuration() * 60;
     }
 
     @Override

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

@@ -200,8 +200,8 @@ public class PlayerListener implements Listener {
         Logger.DEBUG.log("Team 1: " + game.getTeamManager().getTeam1());
         Logger.DEBUG.log("Team 2: " + game.getTeamManager().getTeam2());
 
-        if (game.getArena() != null) {
-            Logger.DEBUG.log("Arena: " + game.getArena().getDisplayName());
+        if (game.getArenaConfig() != null) {
+            Logger.DEBUG.log("Arena: " + game.getArenaConfig().getDisplayName());
         } else {
             Logger.DEBUG.log("Arena: not yet selected (Map Voting)");
         }

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

@@ -53,7 +53,7 @@ public class EndListener extends GameBoundListener {
     public void onRespawn(PlayerRespawnEvent event) {
         if (!isInGameWorld(event.getPlayer().getLocation())) return;
 
-        event.setRespawnLocation(getGame().getArena().getSpectatorSpawn());
+        event.setRespawnLocation(getGame().getArenaConfig().getSpectatorSpawn());
     }
 
     @EventHandler(priority = EventPriority.HIGH)
@@ -64,7 +64,7 @@ public class EndListener extends GameBoundListener {
         MWPlayer mwPlayer = getGame().getPlayer(player);
 
         event.setDeathMessage(null);
-        if (getGame().getArena().isAutoRespawn()) getGame().autoRespawnPlayer(mwPlayer);
+        if (getGame().getArenaConfig().isAutoRespawn()) getGame().autoRespawnPlayer(mwPlayer);
     }
 
     @EventHandler

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

@@ -70,7 +70,7 @@ public class GameListener extends GameBoundListener {
         if (!isInGameWorld(event.getLocation())) return;
 
         if (event.getEntity().getType() != EntityType.FIREBALL) return;
-        if (getGame().getArena().getFireballConfig().isDestroysPortal()) return;
+        if (getGame().getArenaConfig().getFireballConfig().isDestroysPortal()) return;
 
         event.blockList().removeIf(b -> b.getType() == Material.NETHER_PORTAL);
     }
@@ -103,7 +103,7 @@ public class GameListener extends GameBoundListener {
             event.setCancelled(true);
 
             // Can missiles only be spawned if the item interaction was performed on a block (no air)?
-            boolean isOnlyBlockPlaceable = getGame().getArena().getMissileConfig().isOnlyBlockPlaceable();
+            boolean isOnlyBlockPlaceable = getGame().getArenaConfig().getMissileConfig().isOnlyBlockPlaceable();
             if (isOnlyBlockPlaceable) {
                 if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
             }
@@ -139,7 +139,7 @@ public class GameListener extends GameBoundListener {
             // or a projectile hit before.
             if (!snowball.isDead()) getGame().spawnShield(shooter, snowball);
             
-        }, getGame().getArena().getShieldConfig().getFlyTime());
+        }, getGame().getArenaConfig().getShieldConfig().getFlyTime());
     }
 
     @EventHandler
@@ -193,12 +193,12 @@ public class GameListener extends GameBoundListener {
             getGame().setPlayerAttributes(player);
             getGame().getPlayer(player).getPlayerEquipmentRandomizer().resetPlayerInterval();
 
-            FallProtectionConfig fallProtection = getGame().getArena().getFallProtection();
+            FallProtectionConfig fallProtection = getGame().getArenaConfig().getFallProtection();
             if (fallProtection.isEnabled()) {
                 new RespawnGoldBlock(player, fallProtection.getDuration(), fallProtection.isMessageOnlyOnStart(), getGame());
             }
         } else {
-            event.setRespawnLocation(getGame().getArena().getSpectatorSpawn());
+            event.setRespawnLocation(getGame().getArenaConfig().getSpectatorSpawn());
         }
     }
 
@@ -228,7 +228,7 @@ public class GameListener extends GameBoundListener {
         }
 
         event.setDeathMessage(null);
-        if (getGame().getArena().isAutoRespawn()) getGame().autoRespawnPlayer(mwPlayer);
+        if (getGame().getArenaConfig().isAutoRespawn()) getGame().autoRespawnPlayer(mwPlayer);
     }
 
     @EventHandler
@@ -304,10 +304,10 @@ public class GameListener extends GameBoundListener {
         if (player.getGameMode() != GameMode.SURVIVAL) return;
 
         int toY = event.getTo().getBlockY();
-        if (toY > getGame().getArena().getMaxMoveHeight()) {
+        if (toY > getGame().getArenaConfig().getMaxMoveHeight()) {
             player.teleport(event.getFrom());
             player.sendMessage(PluginMessages.getMessage(true, PluginMessages.MessageEnum.ARENA_NOT_HIGHER));
-        } else if (toY < getGame().getArena().getDeathHeight()) {
+        } else if (toY < getGame().getArenaConfig().getDeathHeight()) {
             player.setLastDamageCause(new EntityDamageEvent(player, EntityDamageEvent.DamageCause.FALL, 20));
             player.damage(20.0D);
         }

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

@@ -6,7 +6,7 @@ import com.github.stefvanschie.inventoryframework.pane.OutlinePane;
 import com.github.stefvanschie.inventoryframework.pane.PaginatedPane;
 import com.github.stefvanschie.inventoryframework.pane.component.PercentageBar;
 import de.butzlabben.missilewars.configuration.Config;
-import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.configuration.arena.ArenaConfig;
 import de.butzlabben.missilewars.game.Game;
 import de.butzlabben.missilewars.menus.MenuItem;
 import de.butzlabben.missilewars.menus.MenuUtils;
@@ -19,7 +19,7 @@ import java.util.Map;
 
 public class MapVoteMenu {
     
-    private final Map<String, Arena> arenaDisplayNames = new HashMap<>();
+    private final Map<String, ArenaConfig> arenaDisplayNames = new HashMap<>();
     
     private final MWPlayer mwPlayer;
     private final Game game;
@@ -48,8 +48,8 @@ public class MapVoteMenu {
         MenuItem.setDisplayName(forwardsItemActive, Config.MapVoteMenuItems.FORWARDS_ITEM_ACTIVE.getMessage());
         MenuItem.setDisplayName(forwardsItemInactive, Config.MapVoteMenuItems.FORWARDS_ITEM_INACTIVE.getMessage());
         
-        for (Arena arena : game.getGameConfig().getArenas()) {
-            arenaDisplayNames.put(arena.getDisplayName(), arena);
+        for (ArenaConfig arenaConfig : game.getGameConfig().getArenas()) {
+            arenaDisplayNames.put(arenaConfig.getDisplayName(), arenaConfig);
         }
         
         gui = new ChestGui(6, getTitle());
@@ -87,25 +87,25 @@ public class MapVoteMenu {
                 int nextArenaId = (offset * 5) + n - 1;
                 if (game.getGameConfig().getArenas().size() < (nextArenaId + 1)) break;
                 
-                Arena arena = game.getGameConfig().getArenas().get(nextArenaId);
+                ArenaConfig arenaConfig = game.getGameConfig().getArenas().get(nextArenaId);
                 
                 // arena item:
-                ItemStack item = new ItemStack(Material.valueOf(arena.getDisplayMaterial().toUpperCase()));
+                ItemStack item = new ItemStack(Material.valueOf(arenaConfig.getDisplayMaterial().toUpperCase()));
                 MenuItem.hideMetaValues(item);
                 MenuItem.setDisplayName(item, Config.MapVoteMenuItems.MAP_ITEM.getMessage()
-                        .replace("{arena-name}", arena.getDisplayName()));
-                if (game.getMapVoting().isVotedMapOfPlayer(arena, mwPlayer)) MenuItem.setEnchantment(item);
+                        .replace("{arena-name}", arenaConfig.getDisplayName()));
+                if (game.getMapVoting().isVotedMapOfPlayer(arenaConfig, mwPlayer)) MenuItem.setEnchantment(item);
                 
                 arenas.addItem(new GuiItem(item));
                 
                 // vote percent display
                 voteResultBar = new PercentageBar(1, n - 1, 8, 1);
-                voteResultBar.setPercentage((float) (game.getMapVoting().getPercentOf(arena) / 100));
+                voteResultBar.setPercentage((float) (game.getMapVoting().getPercentOf(arenaConfig) / 100));
                 
                 ItemStack impactDisplayItem = new ItemStack(Material.YELLOW_STAINED_GLASS_PANE);
                 MenuItem.hideMetaValues(item);
                 MenuItem.setDisplayName(impactDisplayItem, Config.MapVoteMenuItems.VOTE_RESULT_BAR.getMessage()
-                        .replace("{vote-percent}", game.getMapVoting().getPercentOfMsg(arena)));
+                        .replace("{vote-percent}", game.getMapVoting().getPercentOfMsg(arenaConfig)));
                 voteResultBar.setFillItem(new GuiItem(impactDisplayItem));
                 
                 ItemStack backgroundItem = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);