michelegargiulo / Witchery-Companion

Other
4 stars 1 forks source link

[Witchery Bug] Boss Spells cause crashes if player variants are disabled #11

Closed Satvn closed 3 months ago

Satvn commented 4 months ago

Description Bosses such as the Lord of torment and Lillith, which use their own spell casting attacks, will cause a rendering entity crash if their player equivalent spell is disabled in the config.

Context On a 1.12 pack pve server, a number of pvp focused or pve unfriendly spells have been disabled via the config to ensure they arent abused, however the bosses in the mod seem to pull from the same spell list as the player, this results in a crash when said disabled spell hits the player, i personally have had this with the lord of torment, with another player experiencing it with lillith, The issue was present upon the disabling of these spells and gone with the re-enabling of these spells.

Environment [ ] The issue is present in Multi-Player

Other mods [ ] The issue is present when the following mods are installed: This was tested on the 1.12 Pack

Steps to Reproduce The more detailed is provided, the easier will be to reproduce and analyze the issue, thus more chances to solve it

  1. disable the spells aguamenti, avada kedavra crucio defodio expelliarmus flipendo incendio stupefy ignianima tormentum

(i am not sure specifically which spells the bosses use, but these are the ones we had disabled)

  1. get attacked by the spell
  2. Crash / Blue screen

Crash Report / logs Lord of Torment: crash-2024-06-02_00.18.33-client.txt

Lilith: crash-2024-06-04_09.17.36-client.txt

Satvn commented 3 months ago

This issue is still reoccuring, albeit with a slightly different disconnect log, now specifically naming net.msrandom.witchery.infusion.symbol.LeonardSymbolEffect as the cause

https://mclo.gs/IRVUSrl https://mclo.gs/9doWmun

michelegargiulo commented 3 months ago

Thanks for the report. I'll reopen the issue, but next time feel free to reopen it yourself or open a new issue if an old problem resurfaces. I might miss it otherwise

michelegargiulo commented 3 months ago

Upon investigation, this turned out to be another problem entirely, and while the resolution of the problem is fairly simple (and fixed in dev), I just cannot understand how this occurred. Do you mind answering a few questions?

  1. Did you enable/disable any spells in config just before you got this crash?
  2. Does it happen everytime you load the world?
  3. Does it happen in new worlds?
  4. Were you fighting Leonard/Other Witchery bosses that use spells (Lilith, Reflection, Leonard or Lord of Torment)?

Your answers might be precious to fix the problem at the root instead of applying a patch where it crashes. Thanks

Edit: bonus question: are client and server configs the same? If unsynced, that might lead to this scenarios, probably also elsewhere

Satvn commented 3 months ago

It was on a server but I do not believe any configs relating to spells were changed from previous settings,

it happened every time the spell was shot at me on repeated attempts, though I haven’t yet tested a new world only an updated one with freshly spawned mobs

I was not fighting Leonard which is why the error confused me, I first noticed it trying to fight my reflection, and then tried it on Lilith and both caused the same error

I believe client and server configs will be mismatched as I haven’t modified my client configs whereas the server functions with a lightly modified list of disabled Witchery things

michelegargiulo commented 3 months ago

First off, thanks for the answers. Unfortunately, the config mismatch is the main suspect, as W:R uses an integer as the spell id. What might be casted as Carnosa Diem by another player on the server will be sent and interpreted by the client as Ignianima. The RenderSpellEffect, responsible of rendering the spell projectile, expects a ProjectileSpellEffect to render, but due to the id mismatch it might not be the case, causing the crash with a ClassCast exception.

As I said before, this issue is fixed in dev, but I would be very surprised if there are no more issues related to this