mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 04:25:14 +01:00
Move comments in above config fields.
This should help avoid confusions as it matches the class' annotation layout and almost every other plugin does it like this.
This commit is contained in:
parent
ae8d1c79e9
commit
88bffc6fde
@ -17,6 +17,10 @@ public class FieldParser {
|
|||||||
public static String parse(Field field) {
|
public static String parse(Field field) {
|
||||||
StringBuilder builder = new StringBuilder(50);
|
StringBuilder builder = new StringBuilder(50);
|
||||||
|
|
||||||
|
if (field.isAnnotationPresent(ConfigurationComment.class)) {
|
||||||
|
builder.append('#').append(field.getAnnotation(ConfigurationComment.class).value()).append('\n');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
builder.append(field.getName()).append(": ").append(ValueParser.parseToYAML(field.get(null)));
|
builder.append(field.getName()).append(": ").append(ValueParser.parseToYAML(field.get(null)));
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
@ -24,10 +28,6 @@ public class FieldParser {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.isAnnotationPresent(ConfigurationComment.class)) {
|
|
||||||
builder.append('\n').append('#').append(field.getAnnotation(ConfigurationComment.class).value());
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user