diff --git a/src/entity/object/AreaEffectCloud.php b/src/entity/object/AreaEffectCloud.php index 6120769cc6..d601c17cf8 100644 --- a/src/entity/object/AreaEffectCloud.php +++ b/src/entity/object/AreaEffectCloud.php @@ -391,7 +391,8 @@ protected function entityBaseTick(int $tickDiff = 1) : bool{ } foreach($ev->getAffectedEntities() as $entity){ - foreach($this->getCloudEffects() as $effect){ + foreach($this->effectContainer->all() as $effect){ + $effect = clone $effect; //avoid accidental modification if($effect->getType() instanceof InstantEffect){ $effect->getType()->applyEffect($entity, $effect, 0.5, $this); }else{ @@ -417,20 +418,6 @@ protected function entityBaseTick(int $tickDiff = 1) : bool{ return $hasUpdate; } - /** - * Returns the effects the area effect cloud provides. - * - * Used to get COPIES to avoid accidentally modifying the same effect instance - * already applied to another entity. - * - * @return EffectInstance[] - */ - public function getCloudEffects() : array{ - return array_map(function(EffectInstance $effect) : EffectInstance{ - return clone $effect; - }, $this->effectContainer->all()); - } - protected function syncNetworkData(EntityMetadataCollection $properties) : void{ parent::syncNetworkData($properties);