SamB440 / Tale-of-Kingdoms

An adventure of glory in the world of Minecraft - Revival of Tale of Kingdoms mod
GNU General Public License v3.0
17 stars 3 forks source link

improperly annotated fields causing crashes #151

Closed Linguardium closed 10 months ago

Linguardium commented 10 months ago

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