mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
More nullable and void typehints
This commit is contained in:
@@ -61,7 +61,7 @@ class PlayerInventory extends BaseInventory{
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function throwIfNotHotbarSlot(int $slot){
|
||||
private function throwIfNotHotbarSlot(int $slot) : void{
|
||||
if(!$this->isHotbarSlot($slot)){
|
||||
throw new \InvalidArgumentException("$slot is not a valid hotbar slot index (expected 0 - " . ($this->getHotbarSize() - 1) . ")");
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class PlayerInventory extends BaseInventory{
|
||||
*
|
||||
* @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) : void{
|
||||
$this->throwIfNotHotbarSlot($hotbarSlot);
|
||||
|
||||
$this->itemInHandIndex = $hotbarSlot;
|
||||
@@ -140,7 +140,7 @@ class PlayerInventory extends BaseInventory{
|
||||
*
|
||||
* @param Player|Player[] $target
|
||||
*/
|
||||
public function sendHeldItem($target){
|
||||
public function sendHeldItem($target) : void{
|
||||
$item = $this->getItemInHand();
|
||||
|
||||
$pk = new MobEquipmentPacket();
|
||||
@@ -170,7 +170,7 @@ class PlayerInventory extends BaseInventory{
|
||||
return 9;
|
||||
}
|
||||
|
||||
public function sendCreativeContents(){
|
||||
public function sendCreativeContents() : void{
|
||||
//TODO: this mess shouldn't be in here
|
||||
$holder = $this->getHolder();
|
||||
if(!($holder instanceof Player)){
|
||||
|
Reference in New Issue
Block a user