mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
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