entity fixes

This commit is contained in:
GameHerobrine 2022-11-10 13:27:22 +03:00
parent 834bb3d486
commit 394ede50e9
4 changed files with 35 additions and 90 deletions

View file

@ -9,6 +9,7 @@ class Minecart extends Vehicle{
function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->canBeAttacked = true;
$this->x = isset($this->data["TileX"]) ? $this->data["TileX"]:$this->x;
$this->y = isset($this->data["TileY"]) ? $this->data["TileY"]:$this->y;
$this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"]:$this->z;
@ -60,6 +61,7 @@ class Minecart extends Vehicle{
$e->isRiding = false;
return true;
}
parent::interactWith($e, $action);
}
public function canRide($e)
@ -67,4 +69,4 @@ class Minecart extends Vehicle{
return !($this->linkedEntity instanceof Entity) && !$e->isRiding;
}
}
}

View file

@ -8,6 +8,7 @@ class Painting extends Hanging{
$this->y = isset($this->data["TileY"]) ? $this->data["TileY"]:$this->y;
$this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"]:$this->z;
$this->setHealth(1, "generic");
$this->canBeAttacked = true;
$this->width = 1;
$this->isStatic = true;
}
@ -28,4 +29,4 @@ class Painting extends Hanging{
$pk->title = $this->data["Motive"];
$player->dataPacket($pk);
}
}
}