Преглед изворни кода

Update Configurate dependency

Lortseam пре 4 година
родитељ
комит
3f75b297f7

+ 1 - 1
gradle.properties

@@ -14,7 +14,7 @@ archives_base_name = completeconfig
 
 # Dependencies
 cloth_config_version=4.11.19
-configurate_version=4.0.0
+configurate_version=4.1.1
 junit_version=5.7.1
 mockito_version=3.9.0
 logcaptor_version=2.5.0

+ 1 - 5
lib/src/main/java/me/lortseam/completeconfig/data/Entry.java

@@ -201,11 +201,7 @@ public class Entry<T> implements DataPart, Identifiable {
     @Override
     public void apply(CommentedConfigurationNode node) {
         try {
-            T value = (T) node.get(type);
-            // value could be null despite the virtual() check
-            // see https://github.com/SpongePowered/Configurate/issues/187
-            if(value == null) return;
-            setValue(value);
+            setValue((T) node.get(type));
         } catch (SerializationException e) {
             logger.error("Failed to apply value to entry", e);
         }

+ 1 - 1
lib/src/main/java/me/lortseam/completeconfig/data/structure/ParentDataPart.java

@@ -11,7 +11,7 @@ public interface ParentDataPart<C extends DataPart & Identifiable> extends DataP
 
     @Override
     default void apply(CommentedConfigurationNode node) {
-        propagateToChildren(childNode -> !childNode.virtual(), DataPart::apply, node);
+        propagateToChildren(childNode -> !childNode.isNull(), DataPart::apply, node);
     }
 
     @Override

+ 1 - 1
lib/src/main/java/me/lortseam/completeconfig/io/ConfigSource.java

@@ -68,7 +68,7 @@ public final class ConfigSource {
     public void load(Config config) {
         try {
             CommentedConfigurationNode root = loader.load();
-            if (!root.virtual()) {
+            if (!root.isNull()) {
                 config.apply(root);
             }
         } catch (ConfigurateException e) {