Spectrum

Spectrum

2M Downloads

Crash with EnchantedShulkers because of enchantment code loop

Yowesephth opened this issue ยท 6 comments

commented

Describe the bug
Game crashes upon reaching title screen. a dirt background with a row of text block icons shows up for a moment, then the game closes.
Trying to remove mods that I feel are causing this conflict according to what I see in the crash log still has all the text in the game replaced with these blocks, and resource packs get unloaded.

To Reproduce
The conflict seems to be with some create content I have installed along with spectrum.
I'm not sure what specific mod might be causing this.
The create mods I had installed are Prominant Create, Create Enchantment Industry, OPAC Create Mod Support, Create Crafts & Additions, Create Deco, Create: Steam 'n' Rails, Create, Bells & Whistles, Create Jetpack, Rechiseled, Create, and Delightful Creators.

I could at least get to the titlescreen with all these create mods installed turned off. (though the titlescreen's text was all replaced with boxes.)

Expected behavior
I was hoping the game would load up and I would be able to play.

Mod version
I attempted this with Spectrum 1.7.4, as well as 1.7.3.
I also tried using both revalationary 1.3.7 and 1.3.6
This was all on 1.20.1, using fabric 0.15.6

Crash Report
here is the crash report:
https://mclo.gs/A1h2kA1

commented

Fixed on EnchantedShulkers side โœ…

commented

It looks like a conflict between Enchanted Shulkers and Spectrum, from that log

commented

seems to be related to this mixin https://github.com/RubixDev/EnchantedShulkers/blob/06e8bec8ce6d68a09836a243a1a8f0418629db97/src/main/java/de/rubixdev/enchantedshulkers/mixin/ItemStackMixin.java#L28
The PreenchantedMultitoolItem (spectrum) redirects GetDefaultStack to GetDefaultEnchantedStack, which calls addEnchantment, which this mixin (enchanted shulkers) makes call GetDefaultStack again, so the stack overflows

commented

It is indeed. See the following:

  • Utils.canEnchant() is called.
  • ItemStack.getDefaultStack() is then called by Spectrums item. Likely the Multitool or the Workstaff.
  • Preenchanted calls ItemStack.addEnchantment() within its getDefaultStack method to add the pre-added enchantments onto it.
  • Enchanted Shulkers calls Utils.canEnchant() in ItemStack.addEnchantment() due to Mixin.
  • This infinitely recurses into a stack overflow, crashing the game.

https://github.com/RubixDev/EnchantedShulkers/blob/main/src/main/java/de/rubixdev/enchantedshulkers/Utils.java#L42-L48

https://github.com/RubixDev/EnchantedShulkers/blob/06e8bec8ce6d68a09836a243a1a8f0418629db97/src/main/java/de/rubixdev/enchantedshulkers/mixin/ItemStackMixin.java#L28-L29

commented

Removing the mod allowed the pack to load up, so that was definitely it.
Think it'd be a good idea to file a bug report with that mod linking to all this?

commented

Please do. Link them to this issue as well