Lortseam преди 4 години
родител
ревизия
dd3ff72a91
променени са 2 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 0 1
      src/main/java/me/lortseam/completeconfig/data/Config.java
  2. 2 2
      src/main/java/me/lortseam/completeconfig/data/ConfigMap.java

+ 0 - 1
src/main/java/me/lortseam/completeconfig/data/Config.java

@@ -117,7 +117,6 @@ public class Config extends Collection {
                 logger.warn("[CompleteConfig] Mod " + modID + " tried to create an empty config!");
                 return null;
             }
-
             return new ConfigHandler(new Config(new ConfigSource(modID, branch), children), guiBuilder);
         }
 

+ 2 - 2
src/main/java/me/lortseam/completeconfig/data/ConfigMap.java

@@ -18,10 +18,10 @@ public abstract class ConfigMap<T extends DataPart> extends LinkedHashMap<String
 
     void putUnique(String id, T value) {
         if (StringUtils.isBlank(id)) {
-            throw new IllegalArgumentException("ID of type " + value.getClass().getSimpleName() + " must not be null or blank");
+            throw new IllegalArgumentException("ID must not be null or blank");
         }
         if (containsKey(id)) {
-            throw new UnsupportedOperationException("A value of type " + value.getClass().getSimpleName() + " with ID " + id + " already exists in the corresponding structure");
+            throw new IllegalArgumentException("Duplicate ID: " + id);
         }
         put(id, value);
     }