diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 84c9ce2e..061fab04 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -627,9 +627,11 @@ class Entity extends Position if($b != 0){ $blockBounds = Block::$class[$b]::getCollisionBoundingBoxes($this->level, $x, $y, $z, $this); foreach($blockBounds as $blockBound){ - $dy = $blockBound->calculateYOffset($this->boundingBox, $dy); - $dx = $blockBound->calculateXOffset($this->boundingBox, $dx); - $dz = $blockBound->calculateZOffset($this->boundingBox, $dz); + if($aABB->intersectsWith($blockBound)){ + $dy = $blockBound->calculateYOffset($this->boundingBox, $dy); + $dx = $blockBound->calculateXOffset($this->boundingBox, $dx); + $dz = $blockBound->calculateZOffset($this->boundingBox, $dz); + } } } } diff --git a/src/world/Level.php b/src/world/Level.php index c2e4f7bb..2ae976c7 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -165,7 +165,7 @@ class Level{ if($bid > 0){ $blockBounds = Block::$class[$bid]::getCollisionBoundingBoxes($this, $x, $y, $z, $e); //StaticBlock::getBoundingBoxForBlockCoords($b, $x, $y, $z); foreach($blockBounds as $blockBound){ - $aABBs[] = $blockBound; + if($aABB->intersectsWith($blockBound)) $aABBs[] = $blockBound; } } } diff --git a/src/world/generator/object/tree/BigTreeObject.php b/src/world/generator/object/tree/BigTreeObject.php index a4a34e21..4616ac26 100644 --- a/src/world/generator/object/tree/BigTreeObject.php +++ b/src/world/generator/object/tree/BigTreeObject.php @@ -29,7 +29,7 @@ class BigTreeObject extends TreeObject{ $leaves = $this->getLeafGroupPoints($level, $pos); foreach($leaves as $leafGroup){ $groupX = $leafGroup->getBlockX(); - $groupY = $leafGrou->getBlockY(); + $groupY = $leafGroup->getBlockY(); $groupZ = $leafGroup->getBlockZ(); for($yy = $groupY; $yy < $groupY + $this->leafDistanceLimit; ++$yy){ $this->generateGroupLayer($level, $groupX, $yy, $groupZ, $this->getLeafGroupLayerSize($yy - $groupY));