mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Sheep can eat grass, zombie can burn on day
This commit is contained in:
parent
a4c1f1e995
commit
c0f4821fbc
3 changed files with 58 additions and 8 deletions
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue