Added check for breeding before preventing sheep event

This commit is contained in:
Georgiy 2013-06-30 20:49:34 -04:00
parent aa07123277
commit 9ff882c526

View File

@ -35,7 +35,7 @@ public class SheepDeshearer implements Listener {
@EventHandler @EventHandler
public void onCreatureSpawn(CreatureSpawnEvent e){ public void onCreatureSpawn(CreatureSpawnEvent e){
if(e.getEntity() instanceof Sheep){ if(e.getEntity() instanceof Sheep && e.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.BREEDING)){
for(DiscoParty party : parent.getParties()){ for(DiscoParty party : parent.getParties()){
if(party.getSheep().contains((Sheep)e.getEntity())){ if(party.getSheep().contains((Sheep)e.getEntity())){
e.setCancelled(true); e.setCancelled(true);