Mithion / Mana-And-Artifice

Ars Magica 3: Mana and Artifice
51 stars 6 forks source link

[1.20.1] Crash on call to canApplyAtEnchantingTable on an item with Beheading on it #836

Open FoxMcloud5655 opened 1 week ago

FoxMcloud5655 commented 1 week ago

Describe the bug When a call to canApplyAtEnchantingTable is called from IForgeItem on an item that has Beheading from Mana & Artifice on it, the server crashes with this error:

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.item.enchantment.EnchantmentCategory.m_7454_(net.minecraft.world.item.Item)" because "enchantment.f_44672_" is null
    at TRANSFORMER/forge@47.2.20/net.minecraftforge.common.extensions.IForgeItem.canApplyAtEnchantingTable(IForgeItem.java:540)
    at TRANSFORMER/forge@47.2.20/net.minecraftforge.common.extensions.IForgeItemStack.canApplyAtEnchantingTable(IForgeItemStack.java:163)

To Reproduce One of the ways this can be replicated is by using Draconic Evolution to upgrade a Wyvern Sword that's enchanted with Beheading to a Draconic Sword in the Fusion Crafting setup.

Version Information (please complete the following information):

Additional context The full crash report was prevented from generating thanks to Neruina, but I can remove the mod and generate a full crash report if needed. The modpack used to observe this behavior is called The Crafty Kettle 2 on CurseForge.