mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-11 04:27:27 +00:00
Fixed configs not showing up in the GUI, if the field name and the annotation name don't match
This commit is contained in:
1 parent
aaba678d37
commit
b1df7dc4b2
1 file changed
+3
-1
@@ -180,7 +180,9 @@ public class ParsedConfiguration {
|
||||
field.setAccessible(true);
|
||||
maxFieldNameLength = Math.max(maxFieldNameLength, field.getName().length());
|
||||
val fieldClass = field.getType();
|
||||
val name = field.getName();
|
||||
val name = Optional.ofNullable(field.getAnnotation(Config.Name.class))
|
||||
.map(Config.Name::value)
|
||||
.orElse(field.getName());
|
||||
AConfigField<?> configField;
|
||||
if (constructors.containsKey(fieldClass)) {
|
||||
fields.put(name, configField = constructors.get(fieldClass).construct(field, rawConfig, category));
|
||||
|
||||
Reference in new issue
Block a user