mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
inventory: populate missing return type information
This commit is contained in:
parent
05c602a044
commit
36cde9f352
@ -84,6 +84,8 @@ abstract class BaseInventory implements Inventory{
|
|||||||
* WARNING: If the size is smaller, any items past the new size will be lost.
|
* WARNING: If the size is smaller, any items past the new size will be lost.
|
||||||
*
|
*
|
||||||
* @param int $size
|
* @param int $size
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSize(int $size){
|
public function setSize(int $size){
|
||||||
$this->slots->setSize($size);
|
$this->slots->setSize($size);
|
||||||
|
@ -142,6 +142,9 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
|||||||
return $this->right;
|
return $this->right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function invalidate(){
|
public function invalidate(){
|
||||||
$this->left = null;
|
$this->left = null;
|
||||||
$this->right = null;
|
$this->right = null;
|
||||||
|
@ -53,6 +53,8 @@ class EnderChestInventory extends ChestInventory{
|
|||||||
* Set the holder's position to that of a tile
|
* Set the holder's position to that of a tile
|
||||||
*
|
*
|
||||||
* @param EnderChest $enderChest
|
* @param EnderChest $enderChest
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setHolderPosition(EnderChest $enderChest){
|
public function setHolderPosition(EnderChest $enderChest){
|
||||||
$this->holder->setComponents($enderChest->getFloorX(), $enderChest->getFloorY(), $enderChest->getFloorZ());
|
$this->holder->setComponents($enderChest->getFloorX(), $enderChest->getFloorY(), $enderChest->getFloorZ());
|
||||||
|
@ -44,6 +44,8 @@ class FurnaceRecipe implements Recipe{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Item $item
|
* @param Item $item
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setInput(Item $item){
|
public function setInput(Item $item){
|
||||||
$this->ingredient = clone $item;
|
$this->ingredient = clone $item;
|
||||||
|
@ -97,7 +97,7 @@ class PlayerInventory extends BaseInventory{
|
|||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
private function throwIfNotHotbarSlot(int $slot){
|
private function throwIfNotHotbarSlot(int $slot) : void{
|
||||||
if(!$this->isHotbarSlot($slot)){
|
if(!$this->isHotbarSlot($slot)){
|
||||||
throw new \InvalidArgumentException("$slot is not a valid hotbar slot index (expected 0 - " . ($this->getHotbarSize() - 1) . ")");
|
throw new \InvalidArgumentException("$slot is not a valid hotbar slot index (expected 0 - " . ($this->getHotbarSize() - 1) . ")");
|
||||||
}
|
}
|
||||||
@ -132,6 +132,7 @@ class PlayerInventory extends BaseInventory{
|
|||||||
* @param bool $send Whether to send updates back to the inventory holder. This should usually be true for plugin calls.
|
* @param bool $send Whether to send updates back to the inventory holder. This should usually be true for plugin calls.
|
||||||
* It should only be false to prevent feedback loops of equipment packets between client and server.
|
* It should only be false to prevent feedback loops of equipment packets between client and server.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @throws \InvalidArgumentException if the hotbar slot is out of range
|
* @throws \InvalidArgumentException if the hotbar slot is out of range
|
||||||
*/
|
*/
|
||||||
public function setHeldItemIndex(int $hotbarSlot, bool $send = true){
|
public function setHeldItemIndex(int $hotbarSlot, bool $send = true){
|
||||||
@ -170,6 +171,8 @@ class PlayerInventory extends BaseInventory{
|
|||||||
* Sends the currently-held item to specified targets.
|
* Sends the currently-held item to specified targets.
|
||||||
*
|
*
|
||||||
* @param Player|Player[] $target
|
* @param Player|Player[] $target
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function sendHeldItem($target){
|
public function sendHeldItem($target){
|
||||||
$item = $this->getItemInHand();
|
$item = $this->getItemInHand();
|
||||||
@ -201,6 +204,9 @@ class PlayerInventory extends BaseInventory{
|
|||||||
return 9;
|
return 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function sendCreativeContents(){
|
public function sendCreativeContents(){
|
||||||
//TODO: this mess shouldn't be in here
|
//TODO: this mess shouldn't be in here
|
||||||
$holder = $this->getHolder();
|
$holder = $this->getHolder();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user