Environmental

Environmental

8M Downloads

[1.20.1] Incompatibility with Alex's Caves - Slabfishes freezes the game when spawned

thelegitdolt opened this issue · 0 comments

commented

If you try to spawn a slabfish when Alex's Caves is installed, the game won't actually spawn a slabfish. I went through the entire entity constructor on debug mode to try to figure out a way to solve the issue, and I did! Yay!

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 other words, this mixin makes LivingEntity.isInWater() 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 uses their own getEyeHeight() implementation, which calls isInWater().
Screenshot 2024-12-18 at 12 25 25 AM
This causes a crash.