fix string configs

This commit is contained in:
FalsePattern committed 2022-09-05 21:53:19 +02:00
1 parent 717e024a4b
commit 60c4edb3ba
1 file changed
+1 -4
@@ -52,7 +52,7 @@ public class StringConfigField extends AConfigField<String> {
Share.LOG
.warn("The field " + field.getName() + " in class " +
field.getDeclaringClass().getName() +
" has no DefaultDouble annotation!\nThis will be a crash in FalsePatternLib 0.11, update your code!");
" has no DefaultString annotation!\nThis will be a crash in FalsePatternLib 0.11, update your code!");
try {
return (String) field.get(null);
} catch (IllegalAccessException e) {
@@ -63,9 +63,6 @@ public class StringConfigField extends AConfigField<String> {
.map(Config.StringMaxLength::value)
.orElse(256);
property.setDefaultValue(defaultValue);
if (!property.isDoubleValue()) {
setToDefault();
}
property.comment +=
"\n[max length: " + maxLength + (pattern != null ? ", pattern: \"" + pattern.pattern() + "\"" : "") +
", default: \"" + defaultValue + "\"]";