Browse Source

Small typo

RedstoneFuture 1 year ago
parent
commit
64ebf601d8

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

@@ -24,14 +24,12 @@ import de.butzlabben.missilewars.configuration.Config;
 import de.butzlabben.missilewars.configuration.arena.Arena;
 import de.butzlabben.missilewars.util.SetupUtil;
 import de.butzlabben.missilewars.util.serialization.Serializer;
+import lombok.Getter;
+import org.bukkit.Bukkit;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import lombok.Getter;
-import org.bukkit.Bukkit;
 
 public class Arenas {
 
@@ -67,7 +65,7 @@ public class Arenas {
             try {
                 Arena arena = Serializer.deserialize(config, Arena.class);
                 arena.setFile(config);
-                if (isArenaExists(arena.getName())) {
+                if (existsArena(arena.getName())) {
                     Logger.WARN.log("There are several arenas configured with the name \"" + arena.getName() + "\". Arenas must have a unique name");
                     continue;
                 }
@@ -86,7 +84,7 @@ public class Arenas {
         return null;
     }
 
-    public static boolean isArenaExists(String arenaName) {
+    public static boolean existsArena(String arenaName) {
         return ARENAS.containsKey(arenaName);
     }
 }

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

@@ -122,7 +122,7 @@ public class Game {
             return;
         }
 
-        if (lobby.getPossibleArenas().stream().noneMatch(Arenas::isArenaExists)) {
+        if (lobby.getPossibleArenas().stream().noneMatch(Arenas::existsArena)) {
             Logger.ERROR.log("None of the specified arenas match a real arena for the lobby \"" + lobby.getName() + "\".");
             return;
         }
@@ -156,7 +156,7 @@ public class Game {
         // choose the game arena
         if (lobby.getMapChooseProcedure() == MapChooseProcedure.FIRST) {
             setArena(lobby.getArenas().get(0));
-            finalGamePreparations();
+            prepareGame();
 
         } else if (lobby.getMapChooseProcedure() == MapChooseProcedure.MAPCYCLE) {
             final int lastMapIndex = cycles.getOrDefault(lobby.getName(), -1);
@@ -164,13 +164,13 @@ public class Game {
             int index = lastMapIndex >= arenas.size() - 1 ? 0 : lastMapIndex + 1;
             cycles.put(lobby.getName(), index);
             setArena(arenas.get(index));
-            finalGamePreparations();
+            prepareGame();
 
         } else if (lobby.getMapChooseProcedure() == MapChooseProcedure.MAPVOTING) {
             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.");
-                finalGamePreparations();
+                prepareGame();
             } else {
                 mapVoting.startVote();
             }
@@ -186,7 +186,7 @@ public class Game {
      * It is necessary that the arena - even in the case of a map vote - is
      * now already defined.
      */
-    public void finalGamePreparations() {
+    public void prepareGame() {
         if (this.arena == null) {
             throw new IllegalStateException("The arena is not yet set");
         }

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

@@ -163,7 +163,7 @@ public class MapVoting {
         game.broadcast(Messages.getMessage(true, Messages.MessageEnum.VOTE_FINISHED)
                 .replace("%map%", game.getArena().getDisplayName()));
 
-        game.finalGamePreparations();
+        game.prepareGame();
     }
     
 }