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

@ -47,6 +47,9 @@ class ItemFrame extends Flowable{
$tile = $this->level->getTile($this);
if(!($tile instanceof TileItemFrame)){
$tile = Tile::createTile(Tile::ITEM_FRAME, $this->getLevel(), TileItemFrame::createNBT($this));
if(!($tile instanceof TileItemFrame)){
return true;
}
}
if($tile->hasItem()){