From a05507f0430bc00b76bb7f8d52d8d4c97a633ef0 Mon Sep 17 00:00:00 2001 From: makamys Date: Thu, 16 Feb 2023 03:35:06 +0100 Subject: [PATCH] Add default value to config comments --- .../unimixins/common/AnnotatedProperties.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java b/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java index 18ac83f..3426301 100644 --- a/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java +++ b/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java @@ -27,6 +27,11 @@ public class AnnotatedProperties { prop = new PropertyToken(comment, key, def); } + prop.defaultValue = def; + + prop.comment.removeIf(s -> s.startsWith("[default:")); + prop.comment.add("[default: " + prop.defaultValue + "]"); + setFieldValue(f, prop.value); propertyTokens.put(key, prop); @@ -105,6 +110,7 @@ public class AnnotatedProperties { public List comment; public String key; public String value; + public String defaultValue; public PropertyToken(List comment, String propertyString) { this.comment = comment;