Sheep can eat grass, zombie can burn on day

This commit is contained in:
ArkQuark 2022-11-03 17:02:47 +03:00
parent a4c1f1e995
commit c0f4821fbc
3 changed files with 58 additions and 8 deletions

View file

@ -8,6 +8,28 @@ class Zombie extends Monster{
$this->setSize(0.6, 1.85);
$this->setSpeed(0.23);
$this->update();
//$this->server->schedule(20, [$this, "burnable"], null, true); //todo
}
public function burnable(){
if($this->fire > 0 or $this->server->api->time->getPhase($this->level->getTime()) == "day"){
return;
}
$y = $this->y;
for(; $y < 129; $y++){
$block = $this->level->getBlock(new Vector3($this->x, $y, $this->z));
if($block->isSolid){ //?
return false;
}
}
$block = $this->level->getBlock(new Vector3($this->x, $y, $this->z))->getID();
if($block === AIR){
$this->fire = 200;
$this->updateMetadata();
return true;
}else{
return false;
}
}
public function getDrops(){