shadowfacts / Forgelin

Fork of Emberwalker's Forgelin with some sprinkles on top.
Other
94 stars 30 forks source link

Forge's Config Annotation System Not Compatible With Forgelin #35

Closed AlexCouch closed 6 years ago

AlexCouch commented 6 years ago

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.

NicholasFeldman commented 6 years ago

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.

AlexCouch commented 6 years ago

Doh! Didn't think about that! Thanks!

shadowfacts commented 6 years ago

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