Lortseam vor 4 Jahren
Ursprung
Commit
dd08d6492b
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      src/main/java/me/lortseam/completeconfig/ConfigHandler.java

+ 3 - 0
src/main/java/me/lortseam/completeconfig/ConfigHandler.java

@@ -64,6 +64,9 @@ public final class ConfigHandler {
         if (HANDLERS.containsKey(owner)) {
             throw new IllegalArgumentException("The specified owner already created a config!");
         }
+        if (HANDLERS.values().stream().anyMatch(handler -> handler.jsonPath.equals(jsonPath))) {
+            throw new IllegalArgumentException("A config of the mod " + modID + "  with the specified branch " + Arrays.toString(branch) + " already exists!");
+        }
         HANDLERS.put(owner, this);
         config = new Config(modID, topLevelCategories, load());
     }