Level: Remove redundant null checks for Item->getBlock()

this is typehinted to return Block, so these checks are pointless.
This commit is contained in:
Dylan K. Taylor 2018-02-16 10:45:54 +00:00
parent 9395dbf9fa
commit 7fc3eeab00

View File

@ -1748,7 +1748,7 @@ class Level implements ChunkManager, Metadatable{
foreach($tag as $v){ foreach($tag as $v){
if($v instanceof StringTag){ if($v instanceof StringTag){
$entry = ItemFactory::fromString($v->getValue()); $entry = ItemFactory::fromString($v->getValue());
if($entry->getId() > 0 and $entry->getBlock() !== null and $entry->getBlock()->getId() === $target->getId()){ if($entry->getId() > 0 and $entry->getBlock()->getId() === $target->getId()){
$canBreak = true; $canBreak = true;
break; break;
} }
@ -1916,7 +1916,7 @@ class Level implements ChunkManager, Metadatable{
foreach($tag as $v){ foreach($tag as $v){
if($v instanceof StringTag){ if($v instanceof StringTag){
$entry = ItemFactory::fromString($v->getValue()); $entry = ItemFactory::fromString($v->getValue());
if($entry->getId() > 0 and $entry->getBlock() !== null and $entry->getBlock()->getId() === $blockClicked->getId()){ if($entry->getId() > 0 and $entry->getBlock()->getId() === $blockClicked->getId()){
$canPlace = true; $canPlace = true;
break; break;
} }