Skip to content

Commit

Permalink
Remove internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Dec 19, 2024
1 parent 2e26c08 commit 6a59e98
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/entity/object/AreaEffectCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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);

Expand Down

0 comments on commit 6a59e98

Please sign in to comment.