rewrite of entity save system

This commit is contained in:
GameHerobrine 2022-11-13 01:53:06 +03:00
parent 2bae9d8f42
commit 3af7ee98b4
8 changed files with 93 additions and 108 deletions

View file

@ -18,6 +18,13 @@ class Sheep extends Animal{
}
}
public function createSaveData(){
$data = parent::createSaveData();
$data["Color"] = @$this->data["Color"];
$data["Sheared"] = @$this->data["Sheared"];
return $data;
}
public function eatGrass(){
$downBlock = $this->level->getBlock(new Vector3($this->x, $this->y-1, $this->z));
if($downBlock->getID() !== GRASS){