FoodStats incompatible with Sponge
squeek502 opened this issue · 1 comments
See squeek502/SpiceOfLife#99 and SpongePowered/SpongeForge#969 and SpongePowered/SpongeForge#916
Sponge re-initializes FoodStats without the EntityPlayer field added by AppleCore, causing the player to be null unexpectedly.
- https://github.com/SpongePowered/SpongeCommon/blob/59ab9633ae5a7209dd385261df6843df825223a2/src/main/java/org/spongepowered/common/mixin/core/entity/player/MixinEntityPlayerMP.java#L489
- https://github.com/squeek502/AppleCore/blob/1.10.2/java/squeek/applecore/asm/reference/FoodStatsModifications.java#L15-L16
Not sure how to best resolve this yet.
Some possible fixes:
- Set the player if it's null every
FoodStats.onUpdate
. This would basically be a band-aid, and would still fail before the first onUpdate call, but it might work to help resolve issues like this in the future - ASM into the modified Sponge code and insert the EntityPlayer into the FoodStats constructor.
Should be fixed with SpongePowered/Sponge@384180f.