Ver Fonte

better warn for wrong start-replace material

RedstoneFuture há 3 anos atrás
pai
commit
869951004d

+ 9 - 6
missilewars-plugin/src/main/java/de/butzlabben/missilewars/Config.java

@@ -161,12 +161,15 @@ public class Config {
         return ret;
     }
 
+    /**
+     * This methode get the material of the block to start the missile.
+     */
     public static Material getStartReplace() {
-        String name = cfg.getString("replace.material", "JUKEBOX").toUpperCase();
+        String name = cfg.getString("replace.material").toUpperCase();
         try {
             return valueOf(name);
         } catch (Exception e) {
-            Logger.WARN.log("Unknown material " + name + " in start_replace");
+            Logger.WARN.log("Could not use " + name + " as start material!");
         }
         return null;
     }
@@ -191,6 +194,10 @@ public class Config {
         return location;
     }
 
+    public static YamlConfiguration getConfig() {
+        return cfg;
+    }
+
     public static String motdEnded() {
         return cfg.getString("motd.ended");
     }
@@ -219,10 +226,6 @@ public class Config {
         return cfg.getBoolean("debug");
     }
 
-    public static YamlConfiguration getConfig() {
-        return cfg;
-    }
-
     public static boolean isSetup() {
         return cfg.getBoolean("setup_mode");
     }