Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.craftstuebchen.particles;
- import org.bukkit.Location;
- import org.bukkit.event.Listener;
- import org.bukkit.scheduler.BukkitRunnable;
- public abstract class ParticleEffect implements Listener {
- private int repeatDelay = 1;
- private String name;
- private Location location;
- private Main main;
- private BukkitRunnable runnable;
- public ParticleEffect(Main main) {
- this.main = main;
- runnable = new BukkitRunnable() {
- @Override
- public void run() {
- onUpdate();
- }
- };
- }
- public ParticleEffect(int repeatDelay, String name, Location location, Main main) {
- this(main);
- this.repeatDelay = repeatDelay;
- this.name = name;
- this.location = location;
- }
- public void start() {
- runnable.runTaskTimer(main, 0, repeatDelay);
- }
- public void stop() {
- runnable.cancel();
- }
- abstract void onUpdate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement