paintings are separated from Entity.php, removed Moved too Quickly warning, small fixes with commands

This commit is contained in:
GameHerobrine 2022-07-12 03:22:06 +03:00
parent 218dd4ffa4
commit af79b29f26
7 changed files with 49 additions and 28 deletions

View file

@ -0,0 +1,28 @@
<?php
class Painting extends Hanging{
const TYPE = OBJECT_PAINTING;
public function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
parent::__construct($level, $eid, $class, $type, $data);
$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;
$this->setHealth(1, "generic");
$this->size = 1;
$this->isStatic = true;
}
public function getDrops(){
return array(array(PAINTING, 0, 1));
}
public function spawn($player){
$pk = new AddPaintingPacket;
$pk->eid = $this->eid;
$pk->x = (int) $this->x;
$pk->y = (int) $this->y;
$pk->z = (int) $this->z;
$pk->direction = $this->getDirection();
$pk->title = $this->data["Motive"];
$player->dataPacket($pk);
}
}