com.quartercode.quarterbukkit.api.particle
Class ParticleSystem

java.lang.Object
  extended by com.quartercode.quarterbukkit.api.particle.ParticleSystem

public class ParticleSystem
extends java.lang.Object

This class represents a complex particle system using firework particles. The system can also get customized with sutom renderers and spawners. All parameters can be changed in real time between to runs.


Constructor Summary
ParticleSystem()
          Creates a new empty particle system.
ParticleSystem(java.util.List<ParticleDescription> descriptions)
          Creates a new particle system and sets the ParticleDescriptions as a List.
ParticleSystem(org.bukkit.Location location)
          Creates a new particle system and sets the start Location.
ParticleSystem(org.bukkit.Location location, java.util.List<ParticleDescription> descriptions)
          Creates a new particle system and sets the start Location and the ParticleDescriptions as a List.
ParticleSystem(org.bukkit.Location location, ParticleDescription... descriptions)
          Creates a new particle system and sets the start Location and the ParticleDescriptions as an array/vararg.
ParticleSystem(ParticleDescription... descriptions)
          Creates a new particle system and sets the ParticleDescriptions as an array/vararg.
 
Method Summary
 ParticleSystem addDescription(ParticleDescription description)
          Adds a ParticleDescription.
protected  void end(org.bukkit.plugin.Plugin plugin, org.bukkit.Location location)
          Gets called when the animation ends.
protected  void execute(org.bukkit.plugin.Plugin plugin, org.bukkit.Location location)
          Executes the particle animation; may override in subclass for more customization.
 org.bukkit.util.Vector getAnimation()
          Returns the movement direction of the spawner as a Vector.
 java.util.List<ParticleDescription> getDescriptions()
          Returns the ParticleDescriptions.
 org.bukkit.Location getLocation()
          Returns the start Location.
 int getRate()
          Returns the delay between two runs.
 int getRuns()
          Returns the count of runs the particle system should emit particles.
 ParticleSpawner getSpawner()
          Returns the ParticleSpawner (default DefaultParticleSpawner).
 boolean isRunning()
          Returns if the particle system is running.
 ParticleSystem removeDescription(ParticleDescription description)
          Removes a ParticleDescription.
 ParticleSystem setAnimation(org.bukkit.util.Vector animation)
          Sets the movement direction of the spawner as a Vector.
 ParticleSystem setDescriptions(java.util.List<ParticleDescription> descriptions)
          Sets the ParticleDescriptions as a List.
 ParticleSystem setDescriptions(ParticleDescription... descriptions)
          Sets the ParticleDescriptions as an array/vararg.
 ParticleSystem setLocation(org.bukkit.Location location)
          Sets the start Location.
 ParticleSystem setRate(int rate)
          Sets the delay between two runs.
 ParticleSystem setRuns(int runs)
          Sets the count of runs the particle system should emit particles.
 ParticleSystem setSpawner(ParticleSpawner spawner)
          Sets the ParticleSpawner.
 ParticleSystem start(org.bukkit.plugin.Plugin plugin)
          Starts the animation and stops the current one if there's already one running.
 ParticleSystem stop()
          Stops the animation if it's running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParticleSystem

public ParticleSystem()
Creates a new empty particle system.


ParticleSystem

public ParticleSystem(org.bukkit.Location location)
Creates a new particle system and sets the start Location.

Parameters:
location - The start Location.

ParticleSystem

public ParticleSystem(ParticleDescription... descriptions)
Creates a new particle system and sets the ParticleDescriptions as an array/vararg.

Parameters:
descriptions - The ParticleDescriptions as an array/vararg.

ParticleSystem

public ParticleSystem(java.util.List<ParticleDescription> descriptions)
Creates a new particle system and sets the ParticleDescriptions as a List.

Parameters:
descriptions - The ParticleDescriptions as a List.

ParticleSystem

public ParticleSystem(org.bukkit.Location location,
                      ParticleDescription... descriptions)
Creates a new particle system and sets the start Location and the ParticleDescriptions as an array/vararg.

Parameters:
location - The start Location.
descriptions - The ParticleDescriptions as an array/vararg.

ParticleSystem

public ParticleSystem(org.bukkit.Location location,
                      java.util.List<ParticleDescription> descriptions)
Creates a new particle system and sets the start Location and the ParticleDescriptions as a List.

Parameters:
location - The start Location.
descriptions - The ParticleDescriptions as a List.
Method Detail

getDescriptions

public java.util.List<ParticleDescription> getDescriptions()
Returns the ParticleDescriptions.

Returns:
The ParticleDescriptions.

setDescriptions

public ParticleSystem setDescriptions(ParticleDescription... descriptions)
Sets the ParticleDescriptions as an array/vararg.

Parameters:
descriptions - The ParticleDescriptions as an array/vararg.
Returns:
This particle system.

setDescriptions

public ParticleSystem setDescriptions(java.util.List<ParticleDescription> descriptions)
Sets the ParticleDescriptions as a List.

Parameters:
descriptions - The ParticleDescriptions as a List.
Returns:
This particle system.

addDescription

public ParticleSystem addDescription(ParticleDescription description)
Adds a ParticleDescription.

Parameters:
description - The ParticleDescription to add.
Returns:
This particle system.

removeDescription

public ParticleSystem removeDescription(ParticleDescription description)
Removes a ParticleDescription.

Parameters:
description - The ParticleDescription to remove.
Returns:
This particle system.

getLocation

public org.bukkit.Location getLocation()
Returns the start Location.

Returns:
The start Location.

setLocation

public ParticleSystem setLocation(org.bukkit.Location location)
Sets the start Location.

Parameters:
location - The start Location.
Returns:
This particle system.

getRuns

public int getRuns()
Returns the count of runs the particle system should emit particles.

Returns:
The count of runs the particle system should emit particles.

setRuns

public ParticleSystem setRuns(int runs)
Sets the count of runs the particle system should emit particles. Set to -1 for endless runs.

Parameters:
runs - The count of runs the particle system should emit particles. Set to -1 for endless runs.
Returns:
This particle system.

getRate

public int getRate()
Returns the delay between two runs.

Returns:
The delay between two runs.

setRate

public ParticleSystem setRate(int rate)
Sets the delay between two runs.

Parameters:
rate - The delay between two runs.
Returns:
This particle system.

getAnimation

public org.bukkit.util.Vector getAnimation()
Returns the movement direction of the spawner as a Vector.

Returns:
The movement direction of the spawner as a Vector.

setAnimation

public ParticleSystem setAnimation(org.bukkit.util.Vector animation)
Sets the movement direction of the spawner as a Vector.

Parameters:
animation - The movement direction of the spawner as a Vector.
Returns:
This particle system.

getSpawner

public ParticleSpawner getSpawner()
Returns the ParticleSpawner (default DefaultParticleSpawner).

Returns:
The ParticleSpawner.

setSpawner

public ParticleSystem setSpawner(ParticleSpawner spawner)
Sets the ParticleSpawner.

Parameters:
spawner - The ParticleSpawner.
Returns:
This particle system.

isRunning

public boolean isRunning()
Returns if the particle system is running.

Returns:
If the particle system is running.

start

public ParticleSystem start(org.bukkit.plugin.Plugin plugin)
Starts the animation and stops the current one if there's already one running.

Parameters:
plugin - The Plugin to bind the ScheduleTask and exception-handling on.
Returns:
This particle system.

stop

public ParticleSystem stop()
Stops the animation if it's running.

Returns:
This particle system.

execute

protected void execute(org.bukkit.plugin.Plugin plugin,
                       org.bukkit.Location location)
Executes the particle animation; may override in subclass for more customization.

Parameters:
plugin - The Plugin to bind the ScheduleTask and exception-handling on.
location - The current particle source.

end

protected void end(org.bukkit.plugin.Plugin plugin,
                   org.bukkit.Location location)
Gets called when the animation ends.

Parameters:
plugin - The Plugin to bind the ScheduleTask and exception-handling on.
location - The current particle source.