Crystal-Nest / soul-fire-d

Let Soul Fire burn!
https://modrinth.com/mod/soul-fire-d
GNU General Public License v3.0
5 stars 2 forks source link

Game crashes when a "speedy zombie" from the mod "MobZ" catches on fire. #37

Closed RearMisser closed 2 months ago

RearMisser commented 7 months ago

To Reproduce Steps to reproduce the behavior:

  1. Go into a world with "Mobz" and Soul Fired loaded.
  2. Spawn the zombie, (or wait for it to spawn, your choice, haha), you can use /summon mobz:fast, not sure if it has a spawn egg.
  3. Set the zombie on fire. Both soul fire and normal fire make the game crash.

Expected behavior Game freezes approx 3 seconds after zombie is set on fire and then crashes with the error message below.

Screenshots image

System information:

Additional context This crash report from my server mentions a Herobrine mod I have installed, so it might also have something to do with it. Not sure though, as I had soul fired and that mod installed way before I installed "Mobz", and it never crashed. Just disabling soul fired also fixes the issue. crash-2024-01-29_19.26.30-server.txt

RearMisser commented 7 months ago

Upon further testing, it appears that it is indeed some incompatibility between the herobrine mod and Mobz. It started crashing the same way, even when soul fired was disabled, right after I published this, (even though it hadn't crashed it the few times I had tested it without soul fired, wtf)

I dunno, it could still involve your mod, and if it does, maybe you could work with the devs of the other mods to fix this? That sounds tiring tho.

Crystal-Spider commented 4 months ago

Waiting for #42

Crystal-Spider commented 2 months ago

I finally had time to test this out properly.

I'm positive this is not an issue with Soul Fire'd, you see it in the logs only because my code intercepts when an entity is about to be hurt with fire and checks whether it should actually be hurt or healed, which damage source to use, etc.
However the real crash happens in this section:

java.lang.StringIndexOutOfBoundsException: begin 17, end 16, length 16
    at java.lang.String.checkBoundsBeginEnd(String.java:4604) ~[?:?] {}
    at java.lang.String.substring(String.java:2707) ~[?:?] {}
    at java.lang.String.substring(String.java:2680) ~[?:?] {}
    at com.lgow.endofherobrine.config.ConfigHandler.shouldPreventPossession(ConfigHandler.java:201) ~[endofherobrine-1.20.2-1.0.8.2.jar%23158!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.util.ModUtil.possessMob(ModUtil.java:59) ~[endofherobrine-1.20.2-1.0.8.2.jar%23158!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.event.PossessionEvents.onMobHurt(PossessionEvents.java:28) ~[endofherobrine-1.20.2-1.0.8.2.jar%23158!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.event.__PossessionEvents_onMobHurt_LivingHurtEvent.invoke(.dynamic) ~[endofherobrine-1.20.2-1.0.8.2.jar%23158!/:1.20.2-1.0.8.2] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:58) ~[eventbus-6.2.0.jar%2392!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:300) ~[eventbus-6.2.0.jar%2392!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:281) ~[eventbus-6.2.0.jar%2392!/:?] {}
    at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:280) ~[forge-1.20.2-48.1.0-universal.jar%23167!/:?] {re:classloading}
    at net.minecraft.world.entity.LivingEntity.m_6475_(LivingEntity.java:1647) ~[client-1.20.2-20230921.100330-srg.jar%23162!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.LivingEntity.m_6469_(LivingEntity.java:1139) ~[client-1.20.2-20230921.100330-srg.jar%23162!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.monster.Zombie.m_6469_(Zombie.java:268) ~[client-1.20.2-20230921.100330-srg.jar%23162!/:?] {re:classloading,xf:fml:forge:forge_method_redirector,pl:mixin:APP:soul_fire_d.mixins.json:ZombieMixin,pl:mixin:A}
    at it.crystalnest.soul_fire_d.api.FireManager.harmOrHeal(FireManager.java:811) ~[soul-fire-d-forge-1.20.2-3.4.3-beta.jar%23161!/:1.20.2-3.4.3-beta] {re:classloading}
    at it.crystalnest.soul_fire_d.api.FireManager.damageOnFire(FireManager.java:789) ~[soul-fire-d-forge-1.20.2-3.4.3-beta.jar%23161!/:1.20.2-3.4.3-beta] {re:classloading}
    at net.minecraft.world.entity.Entity.redirect$zzf002$redirectHurt(Entity.java:3684) ~[client-1.20.2-20230921.100330-srg.jar%23162!/:?] {re:classloading,pl:accesstransformer:B,pl:mixin:A}
    at net.minecraft.world.entity.Entity.m_6075_(Entity.java:459) ~[client-1.20.2-20230921.100330-srg.jar%23162!/:?] {re:classloading,pl:accesstransformer:B,pl:mixin:A}

Here you can see that, once SF successfully redirected the hurt to Forge hooks, and after The End of Herobrine mod makes the game crash.

For comparison, a crash-log without SF installed:

java.lang.StringIndexOutOfBoundsException: begin 17, end 16, length 16
    at java.lang.String.checkBoundsBeginEnd(String.java:4604) ~[?:?] {}
    at java.lang.String.substring(String.java:2707) ~[?:?] {}
    at java.lang.String.substring(String.java:2680) ~[?:?] {}
    at com.lgow.endofherobrine.config.ConfigHandler.shouldPreventPossession(ConfigHandler.java:201) ~[endofherobrine-1.20.2-1.0.8.2.jar%23157!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.util.ModUtil.possessMob(ModUtil.java:59) ~[endofherobrine-1.20.2-1.0.8.2.jar%23157!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.event.PossessionEvents.onMobHurt(PossessionEvents.java:28) ~[endofherobrine-1.20.2-1.0.8.2.jar%23157!/:1.20.2-1.0.8.2] {re:classloading}
    at com.lgow.endofherobrine.event.__PossessionEvents_onMobHurt_LivingHurtEvent.invoke(.dynamic) ~[endofherobrine-1.20.2-1.0.8.2.jar%23157!/:1.20.2-1.0.8.2] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:58) ~[eventbus-6.2.0.jar%23139!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:300) ~[eventbus-6.2.0.jar%23139!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:281) ~[eventbus-6.2.0.jar%23139!/:?] {}
    at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:280) ~[forge-1.20.2-48.1.0-universal.jar%23165!/:?] {re:classloading}
    at net.minecraft.world.entity.LivingEntity.m_6475_(LivingEntity.java:1647) ~[client-1.20.2-20230921.100330-srg.jar%23160!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.LivingEntity.m_6469_(LivingEntity.java:1139) ~[client-1.20.2-20230921.100330-srg.jar%23160!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.monster.Zombie.m_6469_(Zombie.java:268) ~[client-1.20.2-20230921.100330-srg.jar%23160!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.world.entity.Entity.m_6075_(Entity.java:459) ~[client-1.20.2-20230921.100330-srg.jar%23160!/:?] {re:classloading,pl:accesstransformer:B}

Same problem from the Herobrine mod. The log is basically the same, just without the redirection from SF.

I can replicate the crash consistently if I set a soul sand block on fire, spawn a Speedy Zombie on it, and then the zombie walks off the block. When this happens, the game crashes, regardless of whether SF is installed.

I suggest you open an issue for The End of Herobrine mod, if you want you can link there this issue too for more insights on the problem.