Level: rename getCollisionCubes() -> getCollisionBoxes()

these aren't cubes! shoghi, please read the dictionary.
This commit is contained in:
Dylan K. Taylor 2019-01-20 18:11:20 +00:00
parent 425ad6101f
commit 4ae6428641
2 changed files with 4 additions and 4 deletions

View File

@ -1075,7 +1075,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
} }
protected function checkObstruction(float $x, float $y, float $z) : bool{ protected function checkObstruction(float $x, float $y, float $z) : bool{
if(count($this->level->getCollisionCubes($this, $this->getBoundingBox(), false)) === 0){ if(count($this->level->getCollisionBoxes($this, $this->getBoundingBox(), false)) === 0){
return false; return false;
} }
@ -1405,7 +1405,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
assert(abs($dx) <= 20 and abs($dy) <= 20 and abs($dz) <= 20, "Movement distance is excessive: dx=$dx, dy=$dy, dz=$dz"); assert(abs($dx) <= 20 and abs($dy) <= 20 and abs($dz) <= 20, "Movement distance is excessive: dx=$dx, dy=$dy, dz=$dz");
$list = $this->level->getCollisionCubes($this, $this->level->getTickRate() > 1 ? $this->boundingBox->offsetCopy($dx, $dy, $dz) : $this->boundingBox->addCoord($dx, $dy, $dz), false); $list = $this->level->getCollisionBoxes($this, $this->level->getTickRate() > 1 ? $this->boundingBox->offsetCopy($dx, $dy, $dz) : $this->boundingBox->addCoord($dx, $dy, $dz), false);
foreach($list as $bb){ foreach($list as $bb){
$dy = $bb->calculateYOffset($this->boundingBox, $dy); $dy = $bb->calculateYOffset($this->boundingBox, $dy);
@ -1440,7 +1440,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->boundingBox->setBB($axisalignedbb); $this->boundingBox->setBB($axisalignedbb);
$list = $this->level->getCollisionCubes($this, $this->boundingBox->addCoord($dx, $dy, $dz), false); $list = $this->level->getCollisionBoxes($this, $this->boundingBox->addCoord($dx, $dy, $dz), false);
foreach($list as $bb){ foreach($list as $bb){
$dy = $bb->calculateYOffset($this->boundingBox, $dy); $dy = $bb->calculateYOffset($this->boundingBox, $dy);

View File

@ -1165,7 +1165,7 @@ class Level implements ChunkManager, Metadatable{
* *
* @return AxisAlignedBB[] * @return AxisAlignedBB[]
*/ */
public function getCollisionCubes(Entity $entity, AxisAlignedBB $bb, bool $entities = true) : array{ public function getCollisionBoxes(Entity $entity, AxisAlignedBB $bb, bool $entities = true) : array{
$minX = (int) floor($bb->minX - 1); $minX = (int) floor($bb->minX - 1);
$minY = (int) floor($bb->minY - 1); $minY = (int) floor($bb->minY - 1);
$minZ = (int) floor($bb->minZ - 1); $minZ = (int) floor($bb->minZ - 1);