From 88bffc6fde1498220bbac98ac980251d7bb6be25 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Mon, 2 Apr 2018 18:20:52 +0100 Subject: [PATCH] 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. --- .../com/Acrobot/Breeze/Configuration/FieldParser.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/Acrobot/Breeze/Configuration/FieldParser.java b/src/main/java/com/Acrobot/Breeze/Configuration/FieldParser.java index 723d1ba..c240c48 100644 --- a/src/main/java/com/Acrobot/Breeze/Configuration/FieldParser.java +++ b/src/main/java/com/Acrobot/Breeze/Configuration/FieldParser.java @@ -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(); } }