tweaked collisions

This commit is contained in:
GameHerobrine 2024-03-02 18:37:13 +03:00
parent 0a26fbd442
commit 8fca8d09b8
3 changed files with 7 additions and 5 deletions

View file

@ -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);
}
}
}
}