Class EffectManager
java.lang.Object
studio.magemonkey.fabled.api.particle.EffectManager
Handles the management of particle effects and related components
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanUp()static voidclear(org.bukkit.entity.LivingEntity target) Clears effects for a given targetstatic voidclear(EffectTarget target) Clears effects for a given targetstatic IParticleEffectFetches an effect by keystatic EffectInstancegetEffect(EffectTarget target, String key) Fetches an active effect for a given targetstatic EffectDatagetEffectData(EffectTarget target) Gets the effect data for the given targetstatic PolarSettingsgetFormula(String key) Gets a formula by keystatic voidinit()Initializes the utility, loading formulas from the config filestatic voidregister(String key, PolarSettings formula) Registers a new formula for effectsstatic voidregister(IParticleEffect effect) Registers a new particle effect, replacing any conflicting effects already registered under the keystatic voidrunEffect(IParticleEffect effect, EffectTarget target, int ticks, int level) Starts running an effect for a target.static voidtick()Ticks all active effects
-
Constructor Details
-
EffectManager
public EffectManager()
-
-
Method Details
-
init
public static void init()Initializes the utility, loading formulas from the config file -
cleanUp
public static void cleanUp() -
register
Registers a new particle effect, replacing any conflicting effects already registered under the key- Parameters:
effect- effect to register
-
register
Registers a new formula for effects- Parameters:
key- key to register underformula- formula to register
-
getFormula
Gets a formula by key- Parameters:
key- formula key- Returns:
- formula
-
getEffect
Fetches an effect by key- Parameters:
name- name of the effect- Returns:
- particle effect
-
clear
Clears effects for a given target- Parameters:
target- target to clear for
-
clear
public static void clear(org.bukkit.entity.LivingEntity target) Clears effects for a given target- Parameters:
target- target to clear for
-
getEffectData
Gets the effect data for the given target- Parameters:
target- target to get the data for- Returns:
- effect data for the target or null if it doesn't exist
-
getEffect
Fetches an active effect for a given target- Parameters:
target- target to get the effect forkey- effect key- Returns:
- active effect or null if not found
-
runEffect
Starts running an effect for a target. If the effect is already running for the target, the running effect will be stopped before the new one is started.- Parameters:
effect- effect to runtarget- target to run forticks- ticks to run forlevel- effect level
-
tick
public static void tick()Ticks all active effects
-