public final class AnimationAPI
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AnimationAPI.CustomEffectHandler
The CustomEffectHandler class is used for making custom effects
in Animations work as VariableAPI variables
for easier usage
|
Modifier and Type | Field and Description |
---|---|
static java.util.HashMap<java.lang.String,java.lang.Class>
|
effects
Custom effect name - Custom effect class mapping
|
protected static
java.util.concurrent.ScheduledExecutorService |
pool
|
Constructor and Description |
---|
AnimationAPI()
|
Modifier and Type | Method and Description |
---|---|
static void |
init()
Initializes the AnimationAPI:
- registers built in custom effects
- registers a CustomEffectHandler for every custom effect
- registers the AnimationSerializer
|
static AnimationRunnable |
runAnimation(org.bukkit.plugin.Plugin pl,
Animation a,
java.lang.String name,
org.bukkit.entity.Player plr,
AnimationUpdateListener listener)
Starts the execution of an Animation
|
static void |
stopRunningAnimation(AnimationRunnable ar)
Force stops the given AnimationRunnable
|
static void |
stopRunningAnimations(org.bukkit.entity.Player plr)
Force stops every AnimationRunnable linked to the given player.
|
static void |
stopRunningAnimations(org.bukkit.plugin.Plugin pl)
Force stops every AnimationRunnable linked to the given plugin.
|
static void |
stopRunningAnimations(org.bukkit.plugin.Plugin pl,
org.bukkit.entity.Player plr)
Force stops every AnimationRunnable linked to the given plugin
and to the given player.
|
protected static final java.util.concurrent.ScheduledExecutorService pool
public static java.util.HashMap<java.lang.String,java.lang.Class> effects
public static void init()
public static AnimationRunnable runAnimation(org.bukkit.plugin.Plugin pl, Animation a, java.lang.String name, org.bukkit.entity.Player plr, AnimationUpdateListener listener)
pl
- - Plugin which wants to start the Animation, used for auto
stopping it, when the plugin is unloaded
a
- - The runnable Animationname
- - The name under which the Animation should be executed,
this name can help for the plugin
to determine what kind of animation is actually running
plr
- - The player to who this Animation should be linked. Every
placeholder in the Animation will
be filled with his data
listener
- - The AnimationUpdateListener, which should handle every
state change in the animation
public static void stopRunningAnimation(AnimationRunnable ar)
ar
- - The stoppable AnimationRunnablepublic static void stopRunningAnimations(org.bukkit.entity.Player plr)
plr
- - Target playerpublic static void stopRunningAnimations(org.bukkit.plugin.Plugin pl)
pl
- - Target pluginpublic static void stopRunningAnimations(org.bukkit.plugin.Plugin pl, org.bukkit.entity.Player plr)
pl
- - Target pluginplr
- - Target Player