mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +00:00
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.
This commit is contained in:
parent
0b7ff6f2e7
commit
791b4d8ef3
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user