From 23d88c7808ec19dbd9c399442c69b02ab4e6bd4d Mon Sep 17 00:00:00 2001 From: Charlie Wang Date: Sun, 30 Jun 2013 12:11:54 -0400 Subject: [PATCH] Implemented spawnSheep method that stores the spawned sheep in the sheep array --- src/gibstick/bukkit/discosheep/DiscoSheep.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 37a838c..632fc8d 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -3,10 +3,13 @@ package gibstick.bukkit.DiscoSheep; import java.util.ArrayList; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.entity.Sheep; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.World; public final class DiscoSheep extends JavaPlugin { - private ArrayList SheepArray = new ArrayList<>(); + private ArrayList sheepArray = new ArrayList<>(); @Override public void onEnable(){ @@ -18,5 +21,9 @@ public final class DiscoSheep extends JavaPlugin { } + public void spawnSheep(World world, Location loc) { + sheepArray.add((Sheep)world.spawnEntity(loc, EntityType.SHEEP)); + } + }