Added API method Living::hasEffects() (#2054)

This commit is contained in:
Oreo Oreoniv 2018-02-24 16:48:15 +03:00 committed by Dylan K. Taylor
parent e5ec8fa603
commit 2b036b1a5c

View File

@ -232,6 +232,14 @@ abstract class Living extends Entity implements Damageable{
public function hasEffect(int $effectId) : bool{
return isset($this->effects[$effectId]);
}
/**
* Returns whether the mob has any active effects.
* @return bool
*/
public function hasEffects() : bool{
return !empty($this->effects);
}
/**
* Adds an effect to the mob.