From b22d2a625c96c85ff522f48cc189db45501798b2 Mon Sep 17 00:00:00 2001 From: Charlie Wang Date: Sun, 30 Jun 2013 12:25:16 -0400 Subject: [PATCH] declared spawnSheep, removeAllSheep and cycleSheepColours for later use --- .../bukkit/discosheep/DiscoSheep.java | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 632fc8d..37e58b8 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -6,23 +6,43 @@ import org.bukkit.entity.Sheep; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.World; +import org.bukkit.entity.Player; public final class DiscoSheep extends JavaPlugin { - + private ArrayList sheepArray = new ArrayList<>(); - + @Override - public void onEnable(){ + public void onEnable() { getCommand("ds").setExecutor(new DiscoSheepCommandExecutor(this)); } - + @Override - public void onDisable(){ - - } - + public void onDisable() { + } + public void spawnSheep(World world, Location loc) { - sheepArray.add((Sheep)world.spawnEntity(loc, EntityType.SHEEP)); + sheepArray.add((Sheep) world.spawnEntity(loc, EntityType.SHEEP)); + } + + // Spawn some number of sheep next to given player + public void spawnSheep(Player player, Location loc, int num) { + + } + + // Mark all sheep in the sheep array for removal + public void removeAllSheep() { + for (int i = 0; i < sheepArray.size(); i++) { + sheepArray.get(i).remove(); + } + sheepArray.clear(); + } + + // Cycle colours of all sheep in the array + public void cycleSheepColours() { + for (int i = 0; i < sheepArray.size(); i++) { + //sheepArray.get(i) something something + } }