Replace disallowed operators in src/world/

This commit is contained in:
Dylan K. Taylor
2022-01-20 19:05:23 +00:00
parent 282b430b1f
commit aae5962f6a
30 changed files with 102 additions and 102 deletions

View File

@ -51,7 +51,7 @@ abstract class Tree{
public function canPlaceObject(ChunkManager $world, int $x, int $y, int $z, Random $random) : bool{
$radiusToCheck = 0;
for($yy = 0; $yy < $this->treeHeight + 3; ++$yy){
if($yy === 1 or $yy === $this->treeHeight){
if($yy === 1 || $yy === $this->treeHeight){
++$radiusToCheck;
}
for($xx = -$radiusToCheck; $xx < ($radiusToCheck + 1); ++$xx){
@ -105,7 +105,7 @@ abstract class Tree{
$xOff = abs($xx - $x);
for($zz = $z - $mid; $zz <= $z + $mid; ++$zz){
$zOff = abs($zz - $z);
if($xOff === $mid and $zOff === $mid and ($yOff === 0 or $random->nextBoundedInt(2) === 0)){
if($xOff === $mid && $zOff === $mid && ($yOff === 0 || $random->nextBoundedInt(2) === 0)){
continue;
}
if(!$transaction->fetchBlockAt($xx, $yy, $zz)->isSolid()){
@ -117,6 +117,6 @@ abstract class Tree{
}
protected function canOverride(Block $block) : bool{
return $block->canBeReplaced() or $block instanceof Sapling or $block instanceof Leaves;
return $block->canBeReplaced() || $block instanceof Sapling || $block instanceof Leaves;
}
}