emilyploszaj / trinkets

A data-driven accessory mod and API for Minecraft using Fabric.
https://www.curseforge.com/minecraft/mc-mods/trinkets
MIT License
165 stars 72 forks source link

Crash with JEI's cheat mode when the player has 8 or more trinket slots #306

Closed ochotonida closed 4 months ago

ochotonida commented 4 months ago

If the player has any 8 trinket slots, and attempts to cheat in an item from JEI while in the creative mode survival inventory, the game crashes. See https://github.com/ochotonida/artifacts/issues/250 or any of the issues linked there for more information.

Crash report with just JEI, Trinkets, and a data pack: crash-2024-04-13_12.03.55-client.txt

emilyploszaj commented 4 months ago

This is likely related to trinkets adding more slots to the survival inventory, but the crash is on JEI's end.

mezz commented 1 month ago

hi @emilyploszaj I call net.minecraft.world.inventory.AbstractContainerMenu#broadcastChanges which triggers the crash. I am not doing any kind of specific slot math here, just calling a vanilla method to update the player's carried item. Can you help me understand how this crash is happening?

emilyploszaj commented 1 month ago

Is this happening off render thread or similar? Trinkets can modify the amount of slots a player has in an inventory pretty freely and I could imagine threading causing an issue if slots were to be removed, other than that, I can't figure why this issue would occur.

mezz commented 1 month ago

hm good call, let me make sure my fabric packet handling is queuing work onto the render thread correctly

mezz commented 1 month ago

Hmm the stack trace shows Thread: Render thread