Block: fixed correct-type tiles getting overwritten

this manifested by crashing the server whenever someone used a furnace.
This commit is contained in:
Dylan K. Taylor 2019-02-15 13:37:57 +00:00
parent 01255c5368
commit 65ce1a7581

View File

@ -189,8 +189,9 @@ class Block extends Position implements BlockIds, Metadatable{
$oldTile = $this->level->getTile($this);
if($oldTile !== null and ($tileType === null or !($oldTile instanceof $tileType))){
$oldTile->close();
$oldTile = null;
}
if($tileType !== null){
if($oldTile === null and $tileType !== null){
$this->level->addTile(TileFactory::create($tileType, $this->level, $this->asVector3()));
}
}