From df7adad359321c550d4da875f9b5626dae383a3a Mon Sep 17 00:00:00 2001 From: Charlie Wang Date: Sun, 30 Jun 2013 11:44:26 -0400 Subject: [PATCH] ArrayList of sheep to handle sheep that are spawned --- src/gibstick/bukkit/discosheep/DiscoSheep.java | 10 ++++++++-- .../bukkit/discosheep/DiscoSheepCommandExecutor.java | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 363601f..37a838c 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -1,16 +1,22 @@ package gibstick.bukkit.DiscoSheep; +import java.util.ArrayList; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.entity.Sheep; public final class DiscoSheep extends JavaPlugin { + private ArrayList SheepArray = new ArrayList<>(); + @Override public void onEnable(){ - getCommand("ds").setExecutor(new DiscoSheepCommandExecutor()); + getCommand("ds").setExecutor(new DiscoSheepCommandExecutor(this)); } @Override public void onDisable(){ - } + } + + } diff --git a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java index b7219a7..f634d73 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java @@ -3,10 +3,16 @@ package gibstick.bukkit.DiscoSheep; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.CommandExecutor; -import org.bukkit.entity.Sheep; + public class DiscoSheepCommandExecutor implements CommandExecutor { + private DiscoSheep plugin; + + public DiscoSheepCommandExecutor(DiscoSheep plugin) { + this.plugin = plugin; + } + @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {