mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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:
parent
9395dbf9fa
commit
7fc3eeab00
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user