mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
SplashPotion: Use World::getCollidingEntities()
instead of World::getNearbyEntities()
(#5326)
fixes spectator players receiving effects from splash potions
This commit is contained in:
parent
293cea7714
commit
421379fc77
@ -98,8 +98,8 @@ class SplashPotion extends Throwable{
|
|||||||
|
|
||||||
if($hasEffects){
|
if($hasEffects){
|
||||||
if(!$this->willLinger()){
|
if(!$this->willLinger()){
|
||||||
foreach($this->getWorld()->getNearbyEntities($this->boundingBox->expandedCopy(4.125, 2.125, 4.125), $this) as $entity){
|
foreach($this->getWorld()->getCollidingEntities($this->boundingBox->expandedCopy(4.125, 2.125, 4.125), $this) as $entity){
|
||||||
if($entity instanceof Living && $entity->isAlive()){
|
if($entity instanceof Living){
|
||||||
$distanceSquared = $entity->getEyePos()->distanceSquared($this->location);
|
$distanceSquared = $entity->getEyePos()->distanceSquared($this->location);
|
||||||
if($distanceSquared > 16){ //4 blocks
|
if($distanceSquared > 16){ //4 blocks
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user