Expected result: What were you expecting to happen?
When an inventory transaction involving a cursor inventory fails, the cursor inventory gets rolled back.
Actual result: What actually happened?
When an inventory transaction involving a cursor inventory fails, the cursor inventory gets rolled back on the server's side, but not on the client's side.
Steps to reproduce the issue
Cancel an InventoryTransactionEvent where the inventory transaction involves a cursor inventory. The video shows the transaction rolling back (causing the item to be placed back in the chest), however the cursor inventory still holds the item ("ghost item"). On interacting with an inventory slot, the server corrects back the contents of the cursor inventory.
Move the stained glass pane to your cursor inventory.
The plugin cancels all inventory transaction events, so attempting to move the pane will result in the transaction rolling back. However, there is still a ghost glass pane item in the cursor inventory on the client's end.
Issue description
Steps to reproduce the issue
InventoryTransactionEvent
where the inventory transaction involves a cursor inventory. The video shows the transaction rolling back (causing the item to be placed back in the chest), however the cursor inventory still holds the item ("ghost item"). On interacting with an inventory slot, the server corrects back the contents of the cursor inventory.https://user-images.githubusercontent.com/15074389/109976664-da9a4900-7d1d-11eb-8f5d-bdca1510a30d.mp4
OS and versions
Plugins
/itetest
as a player, which will spawn a chest at the location of the command sender. The chest contains a stained glass pane.Debugging
While the server does send the client an inventory update... https://github.com/pmmp/PocketMine-MP/blob/bbae02264ddf02c3b4f0b1e2ec2ac337e3516f40/src/network/mcpe/handler/InGamePacketHandler.php#L327) ...it seems like
InvManager::syncContents()
does not trigger a slot update for PlayerCursorInventory on client's end.InvManager::syncSlot()
on the other hand seems to do the trick.https://user-images.githubusercontent.com/15074389/109978759-061e3300-7d20-11eb-91d7-b42626d08416.mp4