Tile: use phpstan-friendly way to pass block NBT

fixes 1 level 8 error
This commit is contained in:
Dylan K. Taylor
2020-06-27 01:03:20 +01:00
parent 9484220bd5
commit 7e391a8123
2 changed files with 2 additions and 7 deletions

View File

@ -89,8 +89,8 @@ abstract class Tile{
* @throws \RuntimeException
*/
public function copyDataFromItem(Item $item) : void{
if($item->hasCustomBlockData()){ //TODO: check item root tag (MCPE doesn't use BlockEntityTag)
$this->readSaveData($item->getCustomBlockData());
if(($blockNbt = $item->getCustomBlockData()) !== null){ //TODO: check item root tag (MCPE doesn't use BlockEntityTag)
$this->readSaveData($blockNbt);
}
}