mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
ItemStackRequestExecutor: added some missing @throws
This commit is contained in:
parent
c8d9477da1
commit
1a9322c00a
@ -129,6 +129,9 @@ class ItemStackRequestExecutor{
|
|||||||
return [$this->builder->getInventory($inventory), $slot];
|
return [$this->builder->getInventory($inventory), $slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ItemStackRequestProcessException
|
||||||
|
*/
|
||||||
protected function transferItems(ItemStackRequestSlotInfo $source, ItemStackRequestSlotInfo $destination, int $count) : void{
|
protected function transferItems(ItemStackRequestSlotInfo $source, ItemStackRequestSlotInfo $destination, int $count) : void{
|
||||||
$removed = $this->removeItemFromSlot($source, $count);
|
$removed = $this->removeItemFromSlot($source, $count);
|
||||||
$this->addItemToSlot($destination, $removed, $count);
|
$this->addItemToSlot($destination, $removed, $count);
|
||||||
@ -159,6 +162,7 @@ class ItemStackRequestExecutor{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds items to the target slot, if they are stackable.
|
* Adds items to the target slot, if they are stackable.
|
||||||
|
* @throws ItemStackRequestProcessException
|
||||||
*/
|
*/
|
||||||
protected function addItemToSlot(ItemStackRequestSlotInfo $slotInfo, Item $item, int $count) : void{
|
protected function addItemToSlot(ItemStackRequestSlotInfo $slotInfo, Item $item, int $count) : void{
|
||||||
$this->requestSlotInfos[] = $slotInfo;
|
$this->requestSlotInfos[] = $slotInfo;
|
||||||
@ -242,6 +246,9 @@ class ItemStackRequestExecutor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ItemStackRequestProcessException
|
||||||
|
*/
|
||||||
protected function takeCreatedItem(ItemStackRequestSlotInfo $destination, int $count) : void{
|
protected function takeCreatedItem(ItemStackRequestSlotInfo $destination, int $count) : void{
|
||||||
if($count < 1){
|
if($count < 1){
|
||||||
//this should be impossible at the protocol level, but in case of buggy core code this will prevent exploits
|
//this should be impossible at the protocol level, but in case of buggy core code this will prevent exploits
|
||||||
|
Loading…
x
Reference in New Issue
Block a user