Entity collisions, bounding boxes for entites and blocks

This commit is contained in:
GameHerobrine 2022-10-18 21:40:03 +03:00
parent 9154c0fc3d
commit 1448fd21b9
19 changed files with 265 additions and 118 deletions

View file

@ -7,9 +7,9 @@ class Chicken extends Animal{
$server = ServerAPI::request();
$server->schedule(mt_rand(0,6000) + 6000, array($this, "dropAnEgg"));
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 4, "generic");
$this->update();
$this->setName('Chicken');
$this->size = $this->isBaby() ? 0.35 : 0.7;
$this->setSize($this->isBaby() ? 0.2 : 0.4, $this->isBaby() ? 0.35 : 0.7);
$this->update();
}
public function isFood($id){
return $id === PUMPKIN_SEEDS || $id === MELON_SEEDS || $id === BEETROOT_SEEDS || $id === WHEAT_SEEDS;