fix of small error in drop

This commit is contained in:
GameHerobrine 2022-11-13 19:56:32 +03:00
parent 3892d697f8
commit 6ee84717f8
2 changed files with 4 additions and 5 deletions

View file

@ -104,9 +104,8 @@ abstract class Animal extends Creature implements Ageable, Breedable{
public function getDrops(){ public function getDrops(){
if($this->isBaby()){ if($this->isBaby()){
return array( return [];
array(AIR, 0, 0),
);
} }
return parent::getDrops();
} }
} }

View file

@ -287,7 +287,7 @@ class Entity extends Position
public function getDrops() public function getDrops()
{ {
if($this->class === ENTITY_PLAYER and $this->player instanceof Player and ($this->player->gamemode & 0x01) === 0){ 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){ for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++ $i){
$slot = $this->player->getSlot($i); $slot = $this->player->getSlot($i);
$this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0)); $this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0));
@ -312,7 +312,7 @@ class Entity extends Position
} }
return $inv; return $inv;
} }
return array(); return [];
} }
private function spawnDrops() private function spawnDrops()