TileFactory now only manages loading tiles from NBT, not direct creation

my objective is to make this use proper constructors like entities, but there's a couple of obstacles to get around first.
This commit is contained in:
Dylan K. Taylor
2020-06-21 00:47:02 +01:00
parent 1f90aa07aa
commit 1ef6e5e17b
2 changed files with 6 additions and 53 deletions

View File

@ -163,7 +163,12 @@ class Block{
}
}
if($oldTile === null and $tileType !== null){
$this->pos->getWorldNonNull()->addTile(TileFactory::getInstance()->create($tileType, $this->pos->getWorldNonNull(), $this->pos->asVector3()));
/**
* @var Tile $tile
* @see Tile::__construct()
*/
$tile = new $tileType($this->pos->getWorldNonNull(), $this->pos->asVector3());
$this->pos->getWorldNonNull()->addTile($tile);
}
}