Commit e09b2049 authored by CortexPE's avatar CortexPE Committed by SuperXingKong
Browse files

Fix ThrownPotion bug

parent c1fac042
...@@ -73,12 +73,10 @@ class ThrownPotion extends Projectile { ...@@ -73,12 +73,10 @@ class ThrownPotion extends Projectile {
$this->hasSplashed = true; $this->hasSplashed = true;
$color = Potion::getColor($this->getPotionId()); $color = Potion::getColor($this->getPotionId());
$this->getLevel()->addParticle(new SpellParticle($this, $color[0], $color[1], $color[2])); $this->getLevel()->addParticle(new SpellParticle($this, $color[0], $color[1], $color[2]));
$players = $this->getViewers(); $radius = 6;
foreach($players as $p){ foreach ($this->getLevel()->getNearbyEntities($this->getBoundingBox()->grow($radius, $radius, $radius)) as $p) {
if($p->distance($this) <= 6){ foreach(Potion::getEffectsById($this->getPotionId()) as $effect){
foreach(Potion::getEffectsById($this->getPotionId()) as $effect){ $p->addEffect($effect);
$p->addEffect($effect);
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment