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

Fix ThrownPotion bug

parent c1fac042
......@@ -73,14 +73,12 @@ class ThrownPotion extends Projectile {
$this->hasSplashed = true;
$color = Potion::getColor($this->getPotionId());
$this->getLevel()->addParticle(new SpellParticle($this, $color[0], $color[1], $color[2]));
$players = $this->getViewers();
foreach($players as $p){
if($p->distance($this) <= 6){
$radius = 6;
foreach ($this->getLevel()->getNearbyEntities($this->getBoundingBox()->grow($radius, $radius, $radius)) as $p) {
foreach(Potion::getEffectsById($this->getPotionId()) as $effect){
$p->addEffect($effect);
}
}
}
$this->kill();
}
......
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