From 5ecbb93091e8000ec458a0766cf1ebd5a5dd3bbc Mon Sep 17 00:00:00 2001 From: Charlie Wang Date: Sun, 30 Jun 2013 22:08:49 -0400 Subject: [PATCH] actually fixed anti-breeding --- .../bukkit/discosheep/BaaBaaBlockSheepEvents.java | 13 ------------- src/gibstick/bukkit/discosheep/DiscoParty.java | 2 +- src/gibstick/bukkit/discosheep/DiscoSheep.java | 4 ++-- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/gibstick/bukkit/discosheep/BaaBaaBlockSheepEvents.java b/src/gibstick/bukkit/discosheep/BaaBaaBlockSheepEvents.java index afa0318..9898bcb 100644 --- a/src/gibstick/bukkit/discosheep/BaaBaaBlockSheepEvents.java +++ b/src/gibstick/bukkit/discosheep/BaaBaaBlockSheepEvents.java @@ -32,17 +32,4 @@ public class BaaBaaBlockSheepEvents implements Listener { } } } - - @EventHandler - public void onCreatureSpawn(CreatureSpawnEvent e) { - if (e.getEntity() instanceof Sheep && - e.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.BREEDING)) { - for (DiscoParty party : parent.getParties()) { - if (party.getSheep().contains((Sheep) e.getEntity())) { - e.setCancelled(true); - - } - } - } - } } diff --git a/src/gibstick/bukkit/discosheep/DiscoParty.java b/src/gibstick/bukkit/discosheep/DiscoParty.java index 540d289..2e49f9d 100644 --- a/src/gibstick/bukkit/discosheep/DiscoParty.java +++ b/src/gibstick/bukkit/discosheep/DiscoParty.java @@ -55,7 +55,7 @@ public class DiscoParty { newSheep.setHealth(10000); newSheep.setColor(discoColours[(int) Math.round(Math.random() * (discoColours.length - 1))]); newSheep.setTarget(player); - newSheep.setAgeLock(true); + newSheep.setBreed(false); getSheep().add(newSheep); } diff --git a/src/gibstick/bukkit/discosheep/DiscoSheep.java b/src/gibstick/bukkit/discosheep/DiscoSheep.java index 049516c..52c1848 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheep.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheep.java @@ -10,12 +10,12 @@ import org.bukkit.plugin.java.JavaPlugin; public final class DiscoSheep extends JavaPlugin { Map parties = new HashMap(); - private BaaBaaBlockSheepEvents deshear = new BaaBaaBlockSheepEvents(this); + private BaaBaaBlockSheepEvents blockEvents = new BaaBaaBlockSheepEvents(this); @Override public void onEnable() { getCommand("ds").setExecutor(new DiscoSheepCommandExecutor(this)); - getServer().getPluginManager().registerEvents(deshear, this); + getServer().getPluginManager().registerEvents(blockEvents, this); } @Override