Open maxomatic458 opened 3 days ago
While going over the update to 1.21.1 i noticied this note on the packet
When a container window is open, the server never sends updates targeting Window ID 0—all of the window types include slots for the player inventory. The client must automatically apply changes targeting the inventory portion of a container window to the main inventory; the server does not resend them for ID 0 when the window is closed. However, since the armor and offhand slots are only present on ID 0, updates to those slots occurring while a window is open must be deferred by the server until the window's closure.
https://wiki.vg/Protocol#Set_Container_Slot its also present on the version we currently use but with less information https://wiki.vg/index.php?title=Protocol&oldid=18375#Set_Container_Slot
this should be considered when researching this or possibly fixing it by derfering the updates (if we don't do this already)
Yes, this was originally intentional behavior. If an inventory is open, you should operate on the open inventory, not the player inventory. But I do see your point, this should be possible. Consider the following vanilla behavior:
Valence Version
f526a17
What You Did
Im trying to add items to a player while the player is in a inventory, i believe that is perfectly doable by adding the items to the
OpenInventory
in those slots that are actually the players inventory slots.What Went Wrong
However i noticed that when i insert items directly into the player's inventory (while the
OpenInventory
is still attached) the changes where not properly synced, and i do believe that this is unintended behavior.