Class EffectManager

java.lang.Object
de.slikey.effectlib.EffectManager
All Implemented Interfaces:
Disposable

public class EffectManager extends Object implements Disposable
Dispose the EffectManager if you don't need it anymore.
Author:
Kevin
  • Constructor Details

    • EffectManager

      public EffectManager(org.bukkit.plugin.Plugin owningPlugin)
    • EffectManager

      public EffectManager(org.bukkit.plugin.Plugin owningPlugin, Logger logger)
  • Method Details

    • getManagers

      public static List<EffectManager> getManagers()
    • display

      public void display(org.bukkit.Particle particle, org.bukkit.Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount, float size, org.bukkit.Color color, org.bukkit.Material material, byte materialData, double range, List<org.bukkit.entity.Player> targetPlayers)
    • display

      public void display(org.bukkit.Particle particle, ParticleOptions options, org.bukkit.Location center, double range, List<org.bukkit.entity.Player> targetPlayers)
    • start

      public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, org.bukkit.Location origin, org.bukkit.entity.Entity originEntity)
    • start

      public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, org.bukkit.entity.Entity originEntity)
    • start

      public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, org.bukkit.Location origin)
    • start

      public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, org.bukkit.Location origin, org.bukkit.entity.Player targetPlayer)
    • start

      @Deprecated public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, org.bukkit.Location origin, org.bukkit.Location target, org.bukkit.entity.Entity originEntity, org.bukkit.entity.Entity targetEntity, Map<String,String> parameterMap)
      Deprecated.
      Start an Effect from a Configuration map of parameters.
      Parameters:
      effectClass - The name of the Effect class to instantiate. If unqualified, defaults to the de.slikey.effectlib.effect namespace.
      parameters - A Configuration-driven map of key/value parameters. Each of these will be applied directly to the corresponding field in the Effect instance.
      origin - The origin Location
      target - The target Location, only used in some Effects (like LineEffect)
      originEntity - The origin Entity, the effect will attach to the Entity's Location
      targetEntity - The target Entity, only used in some Effects
      parameterMap - A map of parameter values to replace. These must start with the "$" character, values in the parameters map that contain a $key will be replaced with the value in this parameterMap.
      Returns:
      effect or null
    • start

      @Deprecated public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, Map<String,String> parameterMap)
      Deprecated.
      Start an Effect from a Configuration map of parameters.
      Parameters:
      effectClass - The name of the Effect class to instantiate. If unqualified, defaults to the de.slikey.effectlib.effect namespace.
      parameters - A Configuration-driven map of key/value parameters. Each of these will be applied directly to the corresponding field in the Effect instance.
      origin - The origin Location
      target - The target Location, only used in some Effects (like LineEffect)
      parameterMap - A map of parameter values to replace. These must start with the "$" character, values in the parameters map that contain a $key will be replaced with the value in this parameterMap.
      Returns:
      effect or null
    • getEffectByClassName

      public Effect getEffectByClassName(String effectClass)
    • start

      public void start(Effect effect)
    • getEffect

      public Effect getEffect(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, org.bukkit.configuration.ConfigurationSection parameterMap, org.bukkit.entity.Player targetPlayer, String logContext)
    • getEffect

      public Effect getEffect(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, org.bukkit.configuration.ConfigurationSection parameterMap, List<org.bukkit.entity.Player> targetPlayers, String logContext)
    • start

      @Deprecated public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, Map<String,String> parameterMap, org.bukkit.entity.Player targetPlayer)
      Deprecated.
    • start

      public Effect start(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, org.bukkit.configuration.ConfigurationSection parameterMap, org.bukkit.entity.Player targetPlayer)
      Start an effect, possibly using parameter replacement.
      Parameters:
      effectClass - the effect class to start
      parameters - any parameters to pass to the effect
      origin - the origin location
      target - the target location
      parameterMap - a configuration of variables from the parameter config to replace
      targetPlayer - The player who should see this effect.
      Returns:
      effect or null
    • cancel

      public void cancel(boolean callback)
    • done

      public void done(Effect effect)
    • removeEffect

      public void removeEffect(Effect effect)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface Disposable
    • disposeOnTermination

      public void disposeOnTermination()
    • isDisposed

      public boolean isDisposed()
    • isDisposedOnTermination

      public boolean isDisposedOnTermination()
    • enableDebug

      public void enableDebug(boolean enable)
    • enableStackTraces

      public void enableStackTraces(boolean enable)
    • isDebugEnabled

      public boolean isDebugEnabled()
    • onError

      public void onError(Throwable ex)
    • getEffect

      public Effect getEffect(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, org.bukkit.configuration.ConfigurationSection parameterMap, List<org.bukkit.entity.Player> targetPlayers)
    • getEffect

      public Effect getEffect(String effectClass, org.bukkit.configuration.ConfigurationSection parameters, DynamicLocation origin, DynamicLocation target, org.bukkit.configuration.ConfigurationSection parameterMap, org.bukkit.entity.Player targetPlayer)
    • onError

      public void onError(String message, Throwable ex)
    • getLogger

      public Logger getLogger()
    • getEffects

      public Map<Effect,org.bukkit.scheduler.BukkitTask> getEffects()
    • getParticleRange

      public int getParticleRange()
    • setParticleRange

      public void setParticleRange(int range)
    • getOwningPlugin

      public org.bukkit.plugin.Plugin getOwningPlugin()
    • onError

      public void onError(String message)
    • setField

      protected boolean setField(Object effect, String key, org.bukkit.configuration.ConfigurationSection section, org.bukkit.configuration.ConfigurationSection parameterMap, String logContext)
    • disposeAll

      public static void disposeAll()
    • setImageCacheFolder

      public void setImageCacheFolder(File folder)
    • getImageCacheFolder

      public File getImageCacheFolder()
    • loadImage

      public void loadImage(String fileName, ImageLoadCallback callback)
    • registerEffectClass

      public void registerEffectClass(String key, Class<? extends Effect> effectClass)
    • isPlayerIgnored

      public boolean isPlayerIgnored(org.bukkit.entity.Player player)
    • ignorePlayer

      public void ignorePlayer(org.bukkit.entity.Player player, boolean ignore)
    • isVisiblePlayer

      public boolean isVisiblePlayer(org.bukkit.entity.Player player, org.bukkit.Location center, double distanceSquared)
    • getVisiblePlayers

      public List<org.bukkit.entity.Player> getVisiblePlayers(org.bukkit.Location center, double range)