From 4ae6428641b7c6172947246fbc62510253131b8b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 20 Jan 2019 18:11:20 +0000 Subject: [PATCH] Level: rename getCollisionCubes() -> getCollisionBoxes() these aren't cubes! shoghi, please read the dictionary. --- src/pocketmine/entity/Entity.php | 6 +++--- src/pocketmine/level/Level.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 340af4f303..1c77a10a75 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1075,7 +1075,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } 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; } @@ -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"); - $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){ $dy = $bb->calculateYOffset($this->boundingBox, $dy); @@ -1440,7 +1440,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ $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){ $dy = $bb->calculateYOffset($this->boundingBox, $dy); diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 37876bb680..74104039bd 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1165,7 +1165,7 @@ class Level implements ChunkManager, Metadatable{ * * @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); $minY = (int) floor($bb->minY - 1); $minZ = (int) floor($bb->minZ - 1);