瀏覽代碼

Improved bounded float and double entries

Lortseam 5 年之前
父節點
當前提交
9025c93eef

+ 4 - 4
src/main/java/me/lortseam/completeconfig/CompleteConfig.java

@@ -75,8 +75,8 @@ public final class CompleteConfig {
                 .create()
                 .startFloatField(translationKey, value)
                 .setDefaultValue(defaultValue)
-                //TODO: Add error message
-                .setErrorSupplier(v -> v < extras.getBounds().getMin() || v > extras.getBounds().getMax() ? Optional.of("") : Optional.empty())
+                .setMin(extras.getBounds().getMin())
+                .setMax(extras.getBounds().getMax())
                 .setSaveConsumer(saveConsumer)
                 .build()
         );
@@ -91,8 +91,8 @@ public final class CompleteConfig {
                 .create()
                 .startDoubleField(translationKey, value)
                 .setDefaultValue(defaultValue)
-                //TODO: Add error message
-                .setErrorSupplier(v -> v < extras.getBounds().getMin() || v > extras.getBounds().getMax() ? Optional.of("") : Optional.empty())
+                .setMin(extras.getBounds().getMin())
+                .setMax(extras.getBounds().getMax())
                 .setSaveConsumer(saveConsumer)
                 .build()
         );

+ 1 - 1
src/main/java/me/lortseam/completeconfig/collection/Collection.java

@@ -8,7 +8,7 @@ import java.util.LinkedHashMap;
 
 public class Collection {
 
-    //TODO: Do not save empty maps in json file
+    //TODO: Do not save empty maps in json file or completely remove "entries" and "collections" keys in json file
     @Getter
     private final LinkedHashMap<String, Entry> entries = new LinkedHashMap<>();
     @Getter