Skip to content

Commit

Permalink
fix #45
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Apr 7, 2024
1 parent 952cb33 commit 8188c51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void serialize(JsonWriter writer, ValueTreeNode node) throws IOException

Optional<String> defaultComment = SerializerUtils.getDefaultValueString(defaultValue);
if (defaultComment.isPresent()) {
writer.comment("default: " + defaultComment);
writer.comment("default: " + defaultComment.get());
}

String name = SerializerUtils.getSerializedName(trackedValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.quiltmc.config.api.Constraint;
import org.quiltmc.config.api.MarshallingUtils;
import org.quiltmc.config.api.Serializer;
import org.quiltmc.config.api.annotations.Alias;
import org.quiltmc.config.api.annotations.Comment;
import org.quiltmc.config.api.values.ConfigSerializableObject;
import org.quiltmc.config.api.values.TrackedValue;
Expand All @@ -36,7 +35,6 @@
import org.quiltmc.config.api.values.ValueMap;
import org.quiltmc.config.api.values.ValueTreeNode;
import org.quiltmc.config.impl.util.SerializerUtils;
import org.quiltmc.config.impl.values.ValueKeyImpl;

import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -148,9 +146,7 @@ private static CommentedConfig write(Config config, CommentedConfig commentedCon
}

Optional<String> defaultValueComment = SerializerUtils.getDefaultValueString(defaultValue);
if (defaultValueComment.isPresent()) {
comments.add("default: " + defaultValueComment);
}
defaultValueComment.ifPresent(s -> comments.add("default: " + s));

commentedConfig.add(toNightConfigSerializable(key), convertAny(value.getRealValue()));
} else {
Expand Down

0 comments on commit 8188c51

Please sign in to comment.