Merge branch 'minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2023-05-06 17:20:37 +01:00
19 changed files with 259 additions and 170 deletions

View File

@ -353,8 +353,8 @@ class InGamePacketHandler extends PacketHandler{
//rejects the transaction. The most common example of this is equipping armor by right-click, which doesn't send
//a legacy prediction action for the destination armor slot.
foreach($packet->requestChangedSlots as $containerInfo){
$windowId = ItemStackContainerIdTranslator::translate($containerInfo->getContainerId(), $this->inventoryManager->getCurrentWindowId());
foreach($containerInfo->getChangedSlotIndexes() as $slot){
foreach($containerInfo->getChangedSlotIndexes() as $netSlot){
[$windowId, $slot] = ItemStackContainerIdTranslator::translate($containerInfo->getContainerId(), $this->inventoryManager->getCurrentWindowId(), $netSlot);
$inventoryAndSlot = $this->inventoryManager->locateWindowAndSlot($windowId, $slot);
if($inventoryAndSlot !== null){ //trigger the normal slot sync logic
$this->inventoryManager->onSlotChange($inventoryAndSlot[0], $inventoryAndSlot[1]);