diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 4e48778df..f061728cd 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1392,10 +1392,7 @@ abstract class Entity extends Location implements Metadatable{ $bb = $block->getBoundingBox(); - if($bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox())){ - return true; - } - return false; + return $bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox()); } public function fastMove(float $dx, float $dy, float $dz) : bool{ diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index c073a6e2e..29902a02c 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -437,11 +437,8 @@ class Item implements ItemIds, \JsonSerializable{ } $tag = $this->getNamedTag(); - if(isset($tag->BlockEntityTag) and $tag->BlockEntityTag instanceof CompoundTag){ - return true; - } - return false; + return isset($tag->BlockEntityTag) and $tag->BlockEntityTag instanceof CompoundTag; } public function clearCustomBlockData(){ diff --git a/src/pocketmine/level/format/io/leveldb/LevelDB.php b/src/pocketmine/level/format/io/leveldb/LevelDB.php index 3d155b0a2..37a4b9af6 100644 --- a/src/pocketmine/level/format/io/leveldb/LevelDB.php +++ b/src/pocketmine/level/format/io/leveldb/LevelDB.php @@ -599,11 +599,7 @@ class LevelDB extends BaseLevelProvider{ } public function isChunkGenerated(int $chunkX, int $chunkZ) : bool{ - if($this->chunkExists($chunkX, $chunkZ) and ($chunk = $this->getChunk($chunkX, $chunkZ, false)) !== null){ - return true; - } - - return false; + return $this->chunkExists($chunkX, $chunkZ) and ($chunk = $this->getChunk($chunkX, $chunkZ, false)) !== null; } public function isChunkPopulated(int $chunkX, int $chunkZ) : bool{ diff --git a/src/pocketmine/tile/Chest.php b/src/pocketmine/tile/Chest.php index 5e3a88285..be1344933 100644 --- a/src/pocketmine/tile/Chest.php +++ b/src/pocketmine/tile/Chest.php @@ -213,11 +213,7 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{ } public function isPaired(){ - if(!isset($this->namedtag->pairx) or !isset($this->namedtag->pairz)){ - return false; - } - - return true; + return !(!isset($this->namedtag->pairx) or !isset($this->namedtag->pairz)); } /**