Tile: remove createNBT(), add create(), createFromData(), createFromItem()

This commit is contained in:
Dylan K. Taylor
2018-12-10 19:40:37 +00:00
parent 6dbceda3e8
commit d72e4cb9a1
15 changed files with 105 additions and 95 deletions

View File

@ -70,10 +70,13 @@ class Skull extends Flowable{
public function writeStateToWorld() : void{
parent::writeStateToWorld();
$tile = Tile::createTile(Tile::SKULL, $this->getLevel(), TileSkull::createNBT($this));
if($tile instanceof TileSkull){
$tile->setRotation($this->rotation);
$tile->setType($this->type);
$tile = Tile::create(Tile::SKULL, $this->getLevel(), $this->asVector3());
if($tile !== null){
if($tile instanceof TileSkull){
$tile->setRotation($this->rotation);
$tile->setType($this->type);
}
$this->level->addTile($tile);
}
}