SamB440/Tale-of-Kingdoms

improperly annotated fields causing crashes

Closed this issue · 0 comments

Summary

https://github.com/SamB440/Tale-of-Kingdoms/blob/02107a1d0f8cc48c0f7532da1d211464e4cd6af7/src/main/java/com/convallyria/taleofkingdoms/TaleOfKingdomsAPI.java#L32C1-L35C105

fabric finally fixed the bug that caused annotated fields to be included on both sides. this unfortunately means that the assignment here will fail on non-dedicated servers. the field doesnt exist on clients, so the assignment fails to find the field. the declare and assign being on the same line is just sugar and actually occur at different times at the bytecode level.

Steps to reproduce

launch client game on loader 0.15 (or dedicated server on 0.15)

Expected behaviour

no crash

Mod list

N/A

Possible fixes

I would suggest you fix this using a parent class of the API and then use inheritence to assign the correct type via a dedicated server and client entrypoint rather than trying to jam them together. It would also make the classes more readable

Relevent logs and/or screenshots/videos

No response

Other

No response