mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
null and void typehints
This commit is contained in:
@ -106,7 +106,7 @@ abstract class BaseInventory implements Inventory{
|
||||
* @param Item[] $items
|
||||
* @param bool $send
|
||||
*/
|
||||
public function setContents(array $items, bool $send = true){
|
||||
public function setContents(array $items, bool $send = true) : void{
|
||||
if(count($items) > $this->getSize()){
|
||||
$items = array_slice($items, 0, $this->getSize(), true);
|
||||
}
|
||||
@ -180,7 +180,7 @@ abstract class BaseInventory implements Inventory{
|
||||
return $slots;
|
||||
}
|
||||
|
||||
public function remove(Item $item){
|
||||
public function remove(Item $item) : void{
|
||||
$checkDamage = !$item->hasAnyDamageValue();
|
||||
$checkTags = $item->hasCompoundTag();
|
||||
|
||||
@ -334,7 +334,7 @@ abstract class BaseInventory implements Inventory{
|
||||
return $this->setItem($index, ItemFactory::get(Item::AIR, 0, 0), $send);
|
||||
}
|
||||
|
||||
public function clearAll(){
|
||||
public function clearAll() : void{
|
||||
for($i = 0, $size = $this->getSize(); $i < $size; ++$i){
|
||||
$this->clear($i, false);
|
||||
}
|
||||
@ -353,7 +353,7 @@ abstract class BaseInventory implements Inventory{
|
||||
return $this->holder;
|
||||
}
|
||||
|
||||
public function setMaxStackSize(int $size){
|
||||
public function setMaxStackSize(int $size) : void{
|
||||
$this->maxStackSize = $size;
|
||||
}
|
||||
|
||||
@ -367,19 +367,19 @@ abstract class BaseInventory implements Inventory{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function close(Player $who){
|
||||
public function close(Player $who) : void{
|
||||
$this->onClose($who);
|
||||
}
|
||||
|
||||
public function onOpen(Player $who){
|
||||
public function onOpen(Player $who) : void{
|
||||
$this->viewers[spl_object_hash($who)] = $who;
|
||||
}
|
||||
|
||||
public function onClose(Player $who){
|
||||
public function onClose(Player $who) : void{
|
||||
unset($this->viewers[spl_object_hash($who)]);
|
||||
}
|
||||
|
||||
public function onSlotChange(int $index, Item $before, bool $send){
|
||||
public function onSlotChange(int $index, Item $before, bool $send) : void{
|
||||
if($send){
|
||||
$this->sendSlot($index, $this->getViewers());
|
||||
}
|
||||
@ -389,7 +389,7 @@ abstract class BaseInventory implements Inventory{
|
||||
/**
|
||||
* @param Player|Player[] $target
|
||||
*/
|
||||
public function sendContents($target){
|
||||
public function sendContents($target) : void{
|
||||
if($target instanceof Player){
|
||||
$target = [$target];
|
||||
}
|
||||
@ -415,7 +415,7 @@ abstract class BaseInventory implements Inventory{
|
||||
* @param int $index
|
||||
* @param Player|Player[] $target
|
||||
*/
|
||||
public function sendSlot(int $index, $target){
|
||||
public function sendSlot(int $index, $target) : void{
|
||||
if($target instanceof Player){
|
||||
$target = [$target];
|
||||
}
|
||||
|
Reference in New Issue
Block a user