mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Some condition simplifications suggested by static analysis
This commit is contained in:
parent
eebc52e00b
commit
b4c4005009
@ -1392,10 +1392,7 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
|
|
||||||
$bb = $block->getBoundingBox();
|
$bb = $block->getBoundingBox();
|
||||||
|
|
||||||
if($bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox())){
|
return $bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox());
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fastMove(float $dx, float $dy, float $dz) : bool{
|
public function fastMove(float $dx, float $dy, float $dz) : bool{
|
||||||
|
@ -437,11 +437,8 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tag = $this->getNamedTag();
|
$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(){
|
public function clearCustomBlockData(){
|
||||||
|
@ -599,11 +599,7 @@ class LevelDB extends BaseLevelProvider{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function isChunkGenerated(int $chunkX, int $chunkZ) : bool{
|
public function isChunkGenerated(int $chunkX, int $chunkZ) : bool{
|
||||||
if($this->chunkExists($chunkX, $chunkZ) and ($chunk = $this->getChunk($chunkX, $chunkZ, false)) !== null){
|
return $this->chunkExists($chunkX, $chunkZ) and ($chunk = $this->getChunk($chunkX, $chunkZ, false)) !== null;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isChunkPopulated(int $chunkX, int $chunkZ) : bool{
|
public function isChunkPopulated(int $chunkX, int $chunkZ) : bool{
|
||||||
|
@ -213,11 +213,7 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function isPaired(){
|
public function isPaired(){
|
||||||
if(!isset($this->namedtag->pairx) or !isset($this->namedtag->pairz)){
|
return !(!isset($this->namedtag->pairx) or !isset($this->namedtag->pairz));
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user