diff --git a/src/main/java/com/gtnewhorizon/gtnhlib/config/ConfigurationManager.java b/src/main/java/com/gtnewhorizon/gtnhlib/config/ConfigurationManager.java index a4a7571..7e6ad3d 100644 --- a/src/main/java/com/gtnewhorizon/gtnhlib/config/ConfigurationManager.java +++ b/src/main/java/com/gtnewhorizon/gtnhlib/config/ConfigurationManager.java @@ -170,6 +170,10 @@ private static void processConfigInternal(Class configClass, String category, || foundCategory && cat.requiresWorldRestart(); for (val field : configClass.getDeclaredFields()) { + if (field.isAnnotationPresent(Config.Ignore.class)) { + continue; + } + if (instance != null && Modifier.isStatic(field.getModifiers())) { throw new ConfigException( "Illegal config field: " + field.getName() @@ -178,10 +182,6 @@ private static void processConfigInternal(Class configClass, String category, + ": Static field in instance context! Did you forget an @Config.Ignore annotation?"); } - if (field.getAnnotation(Config.Ignore.class) != null) { - continue; - } - field.setAccessible(true); if (!ConfigFieldParser.canParse(field)) {