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

[Discord] Flaming arrows cause crash #46

Closed Crystal-Spider closed 2 months ago

Crystal-Spider commented 2 months ago

I have confirmed no other issue reports this bug

I have confirmed the mod is installed on the proper side

Current behavior

My singleplayer world has recently started crashing every time there's a flaming arrow.

Expected behavior

The game should not crash and the flaming arrow should behave as in Vanilla.

Steps to reproduce

  1. Enchant a bow with normal flame
  2. Shoot an arrow and hit an entity
  3. The game crashes

Minecraft version

1.20.1

Mod loader version

Any

Mod version

1.20.1

Other mods

None

Stacktrace and logs

The game crashed whilst ticking entity
  Error: java.lang.ClassCastException: class net.minecraft.world.item.enchantment.ArrowFireEnchantment cannot be cast to class it.crystalnest.soul_fire_d.api.enchantment.FireTypedFlameEnchantment (net.minecraft.world.item.enchantment.ArrowFireEnchantment is in module minecraft@1.20.1 of loader 'TRANSFORMER' @472d7f34; it.crystalnest.soul_fire_d.api.enchantment.FireTypedFlameEnchantment is in module soul_fire_d@4.0.1 of loader 'TRANSFORMER' @472d7f34)

Additional context

No response

Crystal-Spider commented 2 months ago

Replicated, affects all supported Minecraft versions.

This is due to forcefully casting all fire components for enchantments to the fire typed version, but Vanilla ones can't be cast to those classes. In older versions this wasn't happening because normal fire had no associated enchantments.

Should be able to fix and release by today.