mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 01:16:15 +00:00
Level: Remove redundant null checks for Item->getBlock()
this is typehinted to return Block, so these checks are pointless.
This commit is contained in:
@ -1748,7 +1748,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
foreach($tag as $v){
|
||||
if($v instanceof StringTag){
|
||||
$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;
|
||||
break;
|
||||
}
|
||||
@ -1916,7 +1916,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
foreach($tag as $v){
|
||||
if($v instanceof StringTag){
|
||||
$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;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user