mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Updated Math dependency
This commit is contained in:
@ -1478,7 +1478,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
|
||||
Timings::$entityMoveTimer->startTiming();
|
||||
|
||||
$newBB = $this->boundingBox->getOffsetBoundingBox($dx, $dy, $dz);
|
||||
$newBB = $this->boundingBox->offsetCopy($dx, $dy, $dz);
|
||||
|
||||
$list = $this->level->getCollisionCubes($this, $newBB, false);
|
||||
|
||||
@ -1566,7 +1566,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->getOffsetBoundingBox($dx, $dy, $dz) : $this->boundingBox->addCoord($dx, $dy, $dz), false);
|
||||
$list = $this->level->getCollisionCubes($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);
|
||||
|
@ -185,7 +185,7 @@ abstract class Projectile extends Entity{
|
||||
continue;
|
||||
}
|
||||
|
||||
$entityBB = $entity->boundingBox->grow(0.3, 0.3, 0.3);
|
||||
$entityBB = $entity->boundingBox->expandedCopy(0.3, 0.3, 0.3);
|
||||
$entityHitResult = $entityBB->calculateIntercept($start, $end);
|
||||
|
||||
if($entityHitResult === null){
|
||||
|
@ -81,7 +81,7 @@ class SplashPotion extends Throwable{
|
||||
|
||||
if($hasEffects){
|
||||
if(!$this->willLinger()){
|
||||
foreach($this->level->getNearbyEntities($this->boundingBox->grow(4.125, 2.125, 4.125), $this) as $entity){
|
||||
foreach($this->level->getNearbyEntities($this->boundingBox->expandedCopy(4.125, 2.125, 4.125), $this) as $entity){
|
||||
if($entity instanceof Living){
|
||||
$distanceSquared = $entity->distanceSquared($this);
|
||||
if($distanceSquared > 16){ //4 blocks
|
||||
|
Reference in New Issue
Block a user