Alex's Caves

Alex's Caves

7M Downloads

Mod Incompatibility due to unintended mixin behavior

thelegitdolt opened this issue · 1 comments

commented

Alex's Caves has THIS entity mixin:
Screenshot 2024-12-18 at 12 19 30 AM
Which calls LivingEntity.getActiveEffects(). getActiveEffects() returns LivingEntity.activeEffects.values(). LivingEntity.activeEffects is null until it is initialized in the LivingEntity constructor, so a null pointer is thrown. In oter words, LivingEntity.isInWater() will now throw a null pointer if it is called before the LivingEntity constructor is called.

The Entity constructor, which is called before the LivingEntity constructor, calls entity.getEyeHeight().
Screenshot 2024-12-18 at 12 24 24 AM
Slabfishes from the mod Environmental uses their own getEyeHeight() implementation, which calls isInWater().
Screenshot 2024-12-18 at 12 25 25 AM
This causes a null pointer. To fix, you can use an accessor on activeEffects and check if it is null before doing the contents of the mixin.