mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
eliminate remaining empty() usages
This commit is contained in:
@ -79,7 +79,7 @@ abstract class BaseRail extends Flowable{
|
||||
}
|
||||
|
||||
protected function writeStateToMeta() : int{
|
||||
if(empty($this->connections)){
|
||||
if(count($this->connections) === 0){
|
||||
return BlockLegacyMetadata::RAIL_STRAIGHT_NORTH_SOUTH;
|
||||
}
|
||||
return $this->getMetaForState($this->connections);
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
use function count;
|
||||
|
||||
class Fence extends Transparent{
|
||||
/** @var bool[] facing => dummy */
|
||||
@ -80,7 +81,7 @@ class Fence extends Transparent{
|
||||
->trim(Facing::SOUTH, $connectSouth ? 0 : $inset);
|
||||
}
|
||||
|
||||
if(empty($bbs)){
|
||||
if(count($bbs) === 0){
|
||||
//centre post AABB (only needed if not connected on any axis - other BBs overlapping will do this if any connections are made)
|
||||
return [
|
||||
AxisAlignedBB::one()
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
use function count;
|
||||
|
||||
class Thin extends Transparent{
|
||||
/** @var bool[] facing => dummy */
|
||||
@ -71,7 +72,7 @@ class Thin extends Transparent{
|
||||
$bbs[] = $bb;
|
||||
}
|
||||
|
||||
if(empty($bbs)){
|
||||
if(count($bbs) === 0){
|
||||
//centre post AABB (only needed if not connected on any axis - other BBs overlapping will do this if any connections are made)
|
||||
return [
|
||||
AxisAlignedBB::one()->contract($inset, 0, $inset)
|
||||
|
@ -30,6 +30,7 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\world\BlockTransaction;
|
||||
use function array_intersect_key;
|
||||
use function count;
|
||||
|
||||
class Vine extends Flowable{
|
||||
|
||||
@ -113,7 +114,7 @@ class Vine extends Flowable{
|
||||
}
|
||||
|
||||
if($changed){
|
||||
if(empty($this->faces)){
|
||||
if(count($this->faces) === 0){
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
}else{
|
||||
$this->pos->getWorld()->setBlock($this->pos, $this);
|
||||
|
Reference in New Issue
Block a user