Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

Crash when unequipping curio with slot-increasing attribute

Aizistral opened this issue ยท 0 comments

commented

Versions:

  • Curios: 1.18.1-5.0.6.0
  • Forge/Fabric: 1.18.1-39.0.64

Observed Behavior:

It would appear that equipping the curio with attribute modifier for extra slot of the same type as the curio itself, and subsequently unequipping it causes the game to spontaneously explode.

Expected Behavior:

The game does not spontaneously explode.

Steps to Reproduce:

  1. Make some accessory, say, with the help of ICurioItem interface;
  2. Add attribute modifiers to it by overriding ICurioItem#getAttributeModifiers(SlotContext, UUID, ItemStack);
  3. Use ICuriosHelper to include modifier for +1 slot of the same type as accessory itself;
  4. Start up the game;
  5. Open Curios inventory;
  6. Equip the accessory;
  7. Unequip the accessory;
  8. Watch as the game explodes.

Log: latest.log

Additional Context:

I only reproduced this in development environment, singleplayer. The slot in this case is my custom scroll slot with default size of 0, which is "unlocked" through permanent modifier adding +1 slot of the type, applied via ICurioStacksHandler#addPermanentModifier.