Added check for breeding before preventing sheep event
This commit is contained in:
parent
aa07123277
commit
9ff882c526
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user