Skip to content

Commit

Permalink
Remove useless property
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Dec 19, 2024
1 parent 0be33c6 commit 3e17f50
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/entity/object/AreaEffectCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public static function getNetworkTypeId() : string{ return EntityIds::AREA_EFFEC
/** @var array<int, int> entity ID => expiration */
protected array $victims = [];

protected int $nextUpdateAge = self::UPDATE_DELAY;
protected int $maxAge = self::DEFAULT_DURATION;
protected int $maxAgeChangeOnUse = self::DEFAULT_DURATION_CHANGE_ON_USE;

Expand Down Expand Up @@ -151,7 +150,7 @@ protected function initEntity(CompoundTag $nbt) : void{
}
}else{
foreach($this->potionType->getEffects() as $effect){
$this->effectContainer->add($effect);
$this->effectContainer->add($effect->setDuration((int) round($effect->getDuration() / 4)));
if($effect->getType() instanceof InstantEffect){
$this->setReapplicationDelay(0);
}
Expand Down Expand Up @@ -341,12 +340,11 @@ protected function entityBaseTick(int $tickDiff = 1) : bool{
return true;
}
$this->setRadius($radius);
if($this->age >= $this->nextUpdateAge){
if($this->age >= self::UPDATE_DELAY && ($this->age % self::UPDATE_DELAY) === 0){
if($this->age > $this->maxAge){
$this->flagForDespawn();
return true;
}
$this->nextUpdateAge = $this->age + self::UPDATE_DELAY;

foreach($this->victims as $entityId => $expiration){
if($this->age >= $expiration){
Expand Down Expand Up @@ -397,7 +395,7 @@ protected function entityBaseTick(int $tickDiff = 1) : bool{
if($effect->getType() instanceof InstantEffect){
$effect->getType()->applyEffect($entity, $effect, 0.5, $this);
}else{
$entity->getEffects()->add($effect->setDuration((int) round($effect->getDuration() / 4)));
$entity->getEffects()->add($effect);
}
}
if($this->reapplicationDelay !== 0){
Expand Down

0 comments on commit 3e17f50

Please sign in to comment.