Files
Pumpkin/pumpkin-inventory
BitForge 785de6d644 fix(inventory): prevent shield self-deadlock in prepare_hand_item_for_use (#2295)
When a player right-clicks with a shield already in the off-hand,
`prepare_hand_item_for_use` locks the ItemStack Mutex via `held`,
then tries to lock the same Mutex again through `get_or_insert`.
Tokio's Mutex is not reentrant, causing a permanent deadlock that
crashes the server 5 seconds later when the tick loop times out.

Add `PlayerInventory::is_already_equipped()` which uses Arc::ptr_eq
to detect when the item is already in the target slot, and skip the
redundant equip logic before any lock is attempted.

Closes #2288
2026-06-25 19:36:30 +02:00
..
2026-06-12 20:55:29 +02:00