water damage tweaks, using php8 pack functions

This commit is contained in:
GameHerobrine 2024-01-01 08:15:05 +03:00
parent 229a563ff5
commit 68b8232f07
17 changed files with 46 additions and 76 deletions

View file

@ -3,6 +3,7 @@
class Sheep extends Animal{
public $color;
const TYPE = MOB_SHEEP;
function __construct(Level $level, $eid, $class, $type = 0, $data = []){
$this->setSize($this->isBaby() ? 0.45 : 0.9, $this->isBaby() ? 0.675 : 1.3);
parent::__construct($level, $eid, $class, $type, $data);
@ -11,9 +12,9 @@ class Sheep extends Animal{
$this->data["Sheared"] = isset($this->data["Sheared"]) ? $this->data["Sheared"] : 0;
$this->data["Color"] = isset($this->data["Color"]) ? $this->data["Color"] : $this->sheepColor();
$this->setSpeed(0.25);
$this->update();
$this->ai->addTask(new TaskEatTileGoal());
}
public function createSaveData(){
$data = parent::createSaveData();
$data["Color"] = @$this->data["Color"];