From 76bded66df1bc78d209f18bd68f113e8b6b606a3 Mon Sep 17 00:00:00 2001 From: RangerMauve Date: Sun, 30 Jun 2013 15:54:28 -0400 Subject: [PATCH] Changed access of sheep, added ShepDeshearer. --- src/gibstick/bukkit/discosheep/DiscoSheep.java | 14 +++++++++----- .../bukkit/discosheep/SheepDeshearer.java | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 src/gibstick/bukkit/discosheep/SheepDeshearer.java diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 4e54979..f632069 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -25,12 +25,16 @@ public final class DiscoSheep extends JavaPlugin { public void onDisable() { // Watashi Wa Kawaii, Ne? } + + ArrayList getSheep(){ + return sheepArray; + } void spawnSheep(World world, Location loc) { Sheep newSheep = (Sheep) world.spawnEntity(loc, EntityType.SHEEP); newSheep.setMaxHealth(10000); newSheep.setHealth(10000); - sheepArray.add(newSheep); + getSheep().add(newSheep); } // Spawn some number of sheep next to given player @@ -53,15 +57,15 @@ public final class DiscoSheep extends JavaPlugin { // Mark all sheep in the sheep array for removal, then clear the array void removeAllSheep() { - for (int i = 0; i < sheepArray.size(); i++) { - sheepArray.get(i).remove(); + for (Sheep sheep: getSheep()) { + sheep.remove(); } - sheepArray.clear(); + getSheep().clear(); } // Cycle colours of all sheep in the array void cycleSheepColours() { - for (int i = 0; i < sheepArray.size(); i++) { + for (Sheep shep : getSheep()) { //sheepArray.get(i) something something } } diff --git a/src/gibstick/bukkit/discosheep/SheepDeshearer.java b/src/gibstick/bukkit/discosheep/SheepDeshearer.java new file mode 100644 index 0000000..f566f94 --- /dev/null +++ b/src/gibstick/bukkit/discosheep/SheepDeshearer.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package gibstick.bukkit.discosheep; + +import org.bukkit.event.Listener; + +/** + * + * @author Mauve + */ +public class SheepDeshearer implements Listener{ + public SheepDeshearer(DiscoSheep parent){ + + } +}