From 1a9322c00a10b6cb06a43696bd1cd0b0b70ae554 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 21 Mar 2023 00:23:31 +0000 Subject: [PATCH] ItemStackRequestExecutor: added some missing @throws --- src/network/mcpe/handler/ItemStackRequestExecutor.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/network/mcpe/handler/ItemStackRequestExecutor.php b/src/network/mcpe/handler/ItemStackRequestExecutor.php index 002988bff..bdc2937a5 100644 --- a/src/network/mcpe/handler/ItemStackRequestExecutor.php +++ b/src/network/mcpe/handler/ItemStackRequestExecutor.php @@ -129,6 +129,9 @@ class ItemStackRequestExecutor{ return [$this->builder->getInventory($inventory), $slot]; } + /** + * @throws ItemStackRequestProcessException + */ protected function transferItems(ItemStackRequestSlotInfo $source, ItemStackRequestSlotInfo $destination, int $count) : void{ $removed = $this->removeItemFromSlot($source, $count); $this->addItemToSlot($destination, $removed, $count); @@ -159,6 +162,7 @@ class ItemStackRequestExecutor{ /** * Adds items to the target slot, if they are stackable. + * @throws ItemStackRequestProcessException */ protected function addItemToSlot(ItemStackRequestSlotInfo $slotInfo, Item $item, int $count) : void{ $this->requestSlotInfos[] = $slotInfo; @@ -242,6 +246,9 @@ class ItemStackRequestExecutor{ } } + /** + * @throws ItemStackRequestProcessException + */ protected function takeCreatedItem(ItemStackRequestSlotInfo $destination, int $count) : void{ if($count < 1){ //this should be impossible at the protocol level, but in case of buggy core code this will prevent exploits