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:
Phoenix616 2018-04-02 18:20:52 +01:00
parent ae8d1c79e9
commit 88bffc6fde

View File

@ -16,7 +16,11 @@ public class FieldParser {
*/
public static String parse(Field field) {
StringBuilder builder = new StringBuilder(50);
if (field.isAnnotationPresent(ConfigurationComment.class)) {
builder.append('#').append(field.getAnnotation(ConfigurationComment.class).value()).append('\n');
}
try {
builder.append(field.getName()).append(": ").append(ValueParser.parseToYAML(field.get(null)));
} catch (IllegalAccessException e) {
@ -24,10 +28,6 @@ public class FieldParser {
return "";
}
if (field.isAnnotationPresent(ConfigurationComment.class)) {
builder.append('\n').append('#').append(field.getAnnotation(ConfigurationComment.class).value());
}
return builder.toString();
}
}