block: fix some possible crashes when plugins overwrite tile classes in bad ways

phpstan was complaining on level 2, and it's not wrong to ...
This commit is contained in:
Dylan K. Taylor
2019-12-01 09:29:22 +00:00
parent 3968f85c82
commit 47a959dace
3 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,9 @@ class BurningFurnace extends Solid{
$furnace = $this->getLevel()->getTile($this);
if(!($furnace instanceof TileFurnace)){
$furnace = Tile::createTile(Tile::FURNACE, $this->getLevel(), TileFurnace::createNBT($this));
if(!($furnace instanceof TileFurnace)){
return true;
}
}
if(!$furnace->canOpenWith($item->getCustomName())){