Zollern Galaxy

Zollern Galaxy

253k Downloads

Living Entity cast not checked in ZGBlockBase class

TheComputerizer opened this issue ยท 1 comments

commented

Describe the bug
If an entity that is not a living entity triggers the onEntityWalk method in the ZGBlockBase class it will thrown a ClassCastException. This line is what throws the error

Expected behavior
To check the type before casting and not crash

Minecraft and PC Information:

  • Minecraft Version: 1.12.2
  • Forge Version: 14.23.5.2860
  • Mod Version: 2.0.45
  • RAM allocated: 10 GB

Additional context
Here is the crash report. As you can see, this makes the mod unstable to play with AoA3, although it may only be with TickCentral installed as well.

Personally I would recommend doing something like for your frostwalker test but any fix is a good one

boolean isLivingBase = (entityIn instanceof EntityLivingBase);
boolean hasFrostWalkerEnchantment = isLivingBase ? EnchantmentHelper.hasFrostWalkerEnchantment((EntityLivingBase) entityIn) : false;
commented

This has been fixed in the dev environment and will be applied when the new version is stable and released.