public class WauzPlayerEffects
extends java.lang.Object
WauzPlayerEffect
Modifier and Type | Field and Description |
---|---|
private java.util.List<WauzPlayerEffect> |
effects
The list of currently active status effects.
|
Constructor and Description |
---|
WauzPlayerEffects() |
Modifier and Type | Method and Description |
---|---|
boolean |
addEffect(WauzPlayerEffectType type,
WauzPlayerEffectSource source,
int duration)
Adds a new temporary status effect to the player.
|
boolean |
addEffect(WauzPlayerEffectType type,
WauzPlayerEffectSource source,
int duration,
int power)
Adds a new temporary status effect to the player.
|
void |
clearEffects()
Removes all currently active status effects.
|
private java.util.List<WauzPlayerEffect> |
getEffectList() |
int |
getEffectPowerSum(WauzPlayerEffectType type)
Gets the combined strength of the all matching effects.
|
double |
getEffectPowerSumDecimal(WauzPlayerEffectType type)
Gets the combined strength of the all matching effects as decimal number.
|
boolean |
hasEffect(WauzPlayerEffectType type)
Checks if the player has an effect of the given type on them.
|
static void |
progressPlayerEffects(org.bukkit.entity.Player player)
Reduces the duration of all the player's effects by 1 second and removes expired ones.
|
void |
removeEffect(WauzPlayerEffect effect)
Removes a single active status effect.
|
java.lang.String |
toString()
Returns the names of all effects in a scoreboard friendly format.
|
private final java.util.List<WauzPlayerEffect> effects
public boolean addEffect(WauzPlayerEffectType type, WauzPlayerEffectSource source, int duration)
type
- The type of the effect.source
- The source of the effect.duration
- The remaining duration of the effect in seconds.public boolean addEffect(WauzPlayerEffectType type, WauzPlayerEffectSource source, int duration, int power)
type
- The type of the effect.source
- The source of the effect.duration
- The remaining duration of the effect in seconds.power
- The strength of the effect.public boolean hasEffect(WauzPlayerEffectType type)
type
- The type of the effect.public int getEffectPowerSum(WauzPlayerEffectType type)
type
- The type of the effect.public double getEffectPowerSumDecimal(WauzPlayerEffectType type)
type
- The type of the effect.private java.util.List<WauzPlayerEffect> getEffectList()
public void removeEffect(WauzPlayerEffect effect)
effect
- The effect to remove.public void clearEffects()
public java.lang.String toString()
toString
in class java.lang.Object
public static void progressPlayerEffects(org.bukkit.entity.Player player)
player
- The player to progress the effects for.