From 791b4d8ef38e166cf89b352c8c8da77519480aea Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 3 Feb 2019 11:32:47 +0000 Subject: [PATCH] SplashPotion: measure distance from eye height instead of base this fixes effect durations being off (mostly), closes #2650 there are still some minor differences, but this is closer matching than the previous version. --- src/pocketmine/entity/projectile/SplashPotion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/entity/projectile/SplashPotion.php b/src/pocketmine/entity/projectile/SplashPotion.php index 3da50bf1c..5f9ecd9db 100644 --- a/src/pocketmine/entity/projectile/SplashPotion.php +++ b/src/pocketmine/entity/projectile/SplashPotion.php @@ -85,7 +85,7 @@ class SplashPotion extends Throwable{ if(!$this->willLinger()){ foreach($this->level->getNearbyEntities($this->boundingBox->expandedCopy(4.125, 2.125, 4.125), $this) as $entity){ if($entity instanceof Living and $entity->isAlive()){ - $distanceSquared = $entity->distanceSquared($this); + $distanceSquared = $entity->add(0, $entity->getEyeHeight(), 0)->distanceSquared($this); if($distanceSquared > 16){ //4 blocks continue; }