mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Replace disallowed operators in src/world/
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user