From 551ae19d7f312a2916f910144586c3221c6b15c5 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 24 Jun 2022 00:08:06 +0300 Subject: [PATCH] data tag for saddled pigs was added(id 16, type:byte) --- src/entity/Animal.php | 9 ++++++++- src/entity/Entity.php | 13 +++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/entity/Animal.php b/src/entity/Animal.php index 063ceef9..4c99cfc5 100644 --- a/src/entity/Animal.php +++ b/src/entity/Animal.php @@ -7,7 +7,14 @@ abstract class Animal extends Creature implements Ageable, Breedable{ public function isBaby(){ return $this->data["IsBaby"]; } - + public function getMetadata(){ + $d = parent::getMetadata(); + if(!isset($this->data["IsBaby"])){ + $this->data["IsBaby"] = 0; + } + $d[14]["value"] = $this->isBaby(); + return $d; + } public function environmentUpdate(){ if($this->server->api->getProperty("spawn-animals") !== true){ $this->close(); diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 9a8b705d..cf205e15 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -603,12 +603,13 @@ class Entity extends Position{ 16 => array("type" => 0, "value" => 0), 17 => array("type" => 6, "value" => array(0, 0, 0)), ); - if(!isset($this->data["IsBaby"])){ - $this->data["IsBaby"] = 0; - } - $d[14]["value"] = $this->data["IsBaby"]; - if($this->class === ENTITY_OBJECT && $this->type === OBJECT_PRIMEDTNT){ //ladder fix 2.0 - $d[16]["value"] = (int) max(0, $this->data["fuse"] - (microtime(true) - $this->spawntime) * 20); + if($this->class === ENTITY_OBJECT || $this->class === ENTITY_MOB){ //ladder fix 2.0 + if($this->type === OBJECT_PRIMEDTNT){ + $d[16]["value"] = (int) max(0, $this->data["fuse"] - (microtime(true) - $this->spawntime) * 20); + } + if($this->type === MOB_PIG){ /*Saddled Pig*/ + $d[16]["value"] = 0; + } }elseif($this->class === ENTITY_PLAYER){ if($this->player->isSleeping !== false){ $d[16]["value"] = 2;