mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
tweaked collisions
This commit is contained in:
parent
0a26fbd442
commit
8fca8d09b8
3 changed files with 7 additions and 5 deletions
|
|
@ -627,9 +627,11 @@ class Entity extends Position
|
||||||
if($b != 0){
|
if($b != 0){
|
||||||
$blockBounds = Block::$class[$b]::getCollisionBoundingBoxes($this->level, $x, $y, $z, $this);
|
$blockBounds = Block::$class[$b]::getCollisionBoundingBoxes($this->level, $x, $y, $z, $this);
|
||||||
foreach($blockBounds as $blockBound){
|
foreach($blockBounds as $blockBound){
|
||||||
$dy = $blockBound->calculateYOffset($this->boundingBox, $dy);
|
if($aABB->intersectsWith($blockBound)){
|
||||||
$dx = $blockBound->calculateXOffset($this->boundingBox, $dx);
|
$dy = $blockBound->calculateYOffset($this->boundingBox, $dy);
|
||||||
$dz = $blockBound->calculateZOffset($this->boundingBox, $dz);
|
$dx = $blockBound->calculateXOffset($this->boundingBox, $dx);
|
||||||
|
$dz = $blockBound->calculateZOffset($this->boundingBox, $dz);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ class Level{
|
||||||
if($bid > 0){
|
if($bid > 0){
|
||||||
$blockBounds = Block::$class[$bid]::getCollisionBoundingBoxes($this, $x, $y, $z, $e); //StaticBlock::getBoundingBoxForBlockCoords($b, $x, $y, $z);
|
$blockBounds = Block::$class[$bid]::getCollisionBoundingBoxes($this, $x, $y, $z, $e); //StaticBlock::getBoundingBoxForBlockCoords($b, $x, $y, $z);
|
||||||
foreach($blockBounds as $blockBound){
|
foreach($blockBounds as $blockBound){
|
||||||
$aABBs[] = $blockBound;
|
if($aABB->intersectsWith($blockBound)) $aABBs[] = $blockBound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class BigTreeObject extends TreeObject{
|
||||||
$leaves = $this->getLeafGroupPoints($level, $pos);
|
$leaves = $this->getLeafGroupPoints($level, $pos);
|
||||||
foreach($leaves as $leafGroup){
|
foreach($leaves as $leafGroup){
|
||||||
$groupX = $leafGroup->getBlockX();
|
$groupX = $leafGroup->getBlockX();
|
||||||
$groupY = $leafGrou->getBlockY();
|
$groupY = $leafGroup->getBlockY();
|
||||||
$groupZ = $leafGroup->getBlockZ();
|
$groupZ = $leafGroup->getBlockZ();
|
||||||
for($yy = $groupY; $yy < $groupY + $this->leafDistanceLimit; ++$yy){
|
for($yy = $groupY; $yy < $groupY + $this->leafDistanceLimit; ++$yy){
|
||||||
$this->generateGroupLayer($level, $groupX, $yy, $groupZ, $this->getLeafGroupLayerSize($yy - $groupY));
|
$this->generateGroupLayer($level, $groupX, $yy, $groupZ, $this->getLeafGroupLayerSize($yy - $groupY));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue