Shadowfacts' Forgelin

Shadowfacts' Forgelin

108M Downloads

Forge's Config Annotation System Not Compatible With Forgelin

AlexCouch opened this issue ยท 3 comments

commented

When I try using a Config annotation for a simple class with a property inside marked with JvmStatic, it doesn't appear in the config file generated by forge. When I switch to Java, it's in there.

commented

Closing because this has been resolved and isn't Forgelin-related.

commented

You need to use @JvmField instead of @JvmStatic.

Forge's config system uses reflection to search for fields, while Kotlin uses properties. @JvmField will tell the compiler to expose the variable as a field, while @JvmStatic will generate static instances both within the enclosing class, as well as an instance method.

commented

Doh! Didn't think about that! Thanks!