BaseInventory: fixed internalAddItem() setting air slots to air

this bug was introduced in #4237, but it was unnoticed due to having no adverse
effects other than noisy debugs and network traffic.
This commit is contained in:
Dylan K. Taylor 2025-05-29 17:18:45 +01:00
parent 0910a219d4
commit b4b6bbe29f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -256,7 +256,7 @@ abstract class BaseInventory implements Inventory, SlotValidatedInventory{
$slotItem->setCount($slotItem->getCount() + $amount);
$this->setItem($i, $slotItem);
if($newItem->getCount() <= 0){
break;
return $newItem;
}
}
}
@ -270,7 +270,7 @@ abstract class BaseInventory implements Inventory, SlotValidatedInventory{
$slotItem->setCount($amount);
$this->setItem($slotIndex, $slotItem);
if($newItem->getCount() <= 0){
break;
return $newItem;
}
}
}