mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
refactor some more stupid variable names
This commit is contained in:
@ -34,45 +34,45 @@ abstract class Thin extends Transparent{
|
|||||||
|
|
||||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$f = 0.4375;
|
$minX = 0.4375;
|
||||||
$f1 = 0.5625;
|
$maxX = 0.5625;
|
||||||
$f2 = 0.4375;
|
$minZ = 0.4375;
|
||||||
$f3 = 0.5625;
|
$maxZ = 0.5625;
|
||||||
|
|
||||||
$flag = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
$canConnectNorth = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
||||||
$flag1 = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
$canConnectSouth = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
||||||
$flag2 = $this->canConnect($this->getSide(Vector3::SIDE_WEST));
|
$canConnectWest = $this->canConnect($this->getSide(Vector3::SIDE_WEST));
|
||||||
$flag3 = $this->canConnect($this->getSide(Vector3::SIDE_EAST));
|
$canConnectEast = $this->canConnect($this->getSide(Vector3::SIDE_EAST));
|
||||||
|
|
||||||
if((!$flag2 or !$flag3) and ($flag2 or $flag3 or $flag or $flag1)){
|
if((!$canConnectWest or !$canConnectEast) and ($canConnectWest or $canConnectEast or $canConnectNorth or $canConnectSouth)){
|
||||||
if($flag2 and !$flag3){
|
if($canConnectWest and !$canConnectEast){
|
||||||
$f = 0;
|
$minX = 0;
|
||||||
}elseif(!$flag2 and $flag3){
|
}elseif(!$canConnectWest and $canConnectEast){
|
||||||
$f1 = 1;
|
$maxX = 1;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$f = 0;
|
$minX = 0;
|
||||||
$f1 = 1;
|
$maxX = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((!$flag or !$flag1) and ($flag2 or $flag3 or $flag or $flag1)){
|
if((!$canConnectNorth or !$canConnectSouth) and ($canConnectWest or $canConnectEast or $canConnectNorth or $canConnectSouth)){
|
||||||
if($flag and !$flag1){
|
if($canConnectNorth and !$canConnectSouth){
|
||||||
$f2 = 0;
|
$minZ = 0;
|
||||||
}elseif(!$flag and $flag1){
|
}elseif(!$canConnectNorth and $canConnectSouth){
|
||||||
$f3 = 1;
|
$maxZ = 1;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$f2 = 0;
|
$minZ = 0;
|
||||||
$f3 = 1;
|
$maxZ = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + $f,
|
$this->x + $minX,
|
||||||
$this->y,
|
$this->y,
|
||||||
$this->z + $f2,
|
$this->z + $minZ,
|
||||||
$this->x + $f1,
|
$this->x + $maxX,
|
||||||
$this->y + 1,
|
$this->y + 1,
|
||||||
$this->z + $f3
|
$this->z + $maxZ
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user