mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 09:54:10 +00:00
Level: rename getCollisionCubes() -> getCollisionBoxes()
these aren't cubes! shoghi, please read the dictionary.
This commit is contained in:
parent
425ad6101f
commit
4ae6428641
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user