Update EntityAPI.php

This commit is contained in:
ArkQuark 2022-10-20 23:35:02 +03:00
parent 7ea63bdceb
commit 83b7bc4b39
11 changed files with 380 additions and 57 deletions

View file

@ -4,8 +4,7 @@ class Chicken extends Animal{
const TYPE = MOB_CHICKEN;
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
parent::__construct($level, $eid, $class, $type, $data);
$server = ServerAPI::request();
$server->schedule(mt_rand(0,6000) + 6000, array($this, "dropAnEgg"));
$this->server->schedule(mt_rand(0,6000) + 6000, array($this, "dropAnEgg"));
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 4, "generic");
$this->setName('Chicken');
$this->setSize($this->isBaby() ? 0.2 : 0.4, $this->isBaby() ? 0.35 : 0.7);

View file

@ -8,7 +8,6 @@ class Pig extends Animal{
$this->server = ServerAPI::request();
$this->setSize($this->isBaby() ? 0.45 : 0.9, $this->isBaby() ? 0.45 : 0.9);
$this->setName('Pig');
$this->ai->addTask(new TaskLookAround());
$this->update();
}
public function isFood($id){