Zoglin Wildfire crash
KingLem opened this issue ยท 4 comments
java.lang.ClassCastException: class net.minecraft.world.entity.monster.Zoglin cannot be cast to class net.minecraft.world.entity.player.Player (net.minecraft.world.entity.monster.Zoglin and net.minecraft.world.entity.player.Player are in module [email protected] of loader 'TRANSFORMER' @342723a3)
at net.sweenus.simplyswords.effect.WildfireEffect.m_6742_(WildfireEffect.java:35) ~[simplyswords-forge-1.43.1-1.19.2.jar%23537!/:?] {re:classloading}
Looks like there's a weird interaction with whatever causes the WildfireEffect class to be used and Zoglins. Might need to put in a check for entities which can't be cast to Players.
This bug will crash whichever world it happens in and effectively corrupt it, since the code will immediately be executed upon reloading the world and crash the world again.
I'm not quite sure how this issue could even occur, but I've added some failsafes to prevent this crash in the latest release for 1.19.2.
Just had this happen in 1.19.3 (simplyswords-forge-1.43.1-1.19.3). Running hypothesis without looking at any of the code is that an NPC somehow acquired the Wildfire buff (either through picking up a weapon granting that buff or through Occultism's Blessing granting random buffs when hit) and that some part of the buff's code expects either the buffee or some other target to be a Player.
Update: Looking at the git log, it looks like a fix for this (4e0f961...) was checked into the 1.19.3 branch in April but never shipped to CurseForge as a 1.19.3 package. : (