From 6ee84717f83b8aa6d9e0a7b91cce90ffb6ccfea6 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sun, 13 Nov 2022 19:56:32 +0300 Subject: [PATCH] fix of small error in drop --- src/entity/Animal.php | 5 ++--- src/entity/Entity.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/entity/Animal.php b/src/entity/Animal.php index ca929158..b0a349f0 100644 --- a/src/entity/Animal.php +++ b/src/entity/Animal.php @@ -104,9 +104,8 @@ abstract class Animal extends Creature implements Ageable, Breedable{ public function getDrops(){ if($this->isBaby()){ - return array( - array(AIR, 0, 0), - ); + return []; } + return parent::getDrops(); } } \ No newline at end of file diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 129b2ae2..b874319d 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -287,7 +287,7 @@ class Entity extends Position public function getDrops() { if($this->class === ENTITY_PLAYER and $this->player instanceof Player and ($this->player->gamemode & 0x01) === 0){ - $inv = array(); + $inv = []; for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++ $i){ $slot = $this->player->getSlot($i); $this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0)); @@ -312,7 +312,7 @@ class Entity extends Position } return $inv; } - return array(); + return []; } private function spawnDrops()