Added to SheepDeshearer to prevent sheep from breeding.
This commit is contained in:
parent
8863b401c9
commit
28fdb0d055
@ -4,10 +4,10 @@
|
||||
*/
|
||||
package gibstick.bukkit.discosheep;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
/**
|
||||
@ -32,4 +32,15 @@ public class SheepDeshearer implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCreatureSpawn(CreatureSpawnEvent e){
|
||||
if(e.getEntity() instanceof Sheep){
|
||||
for(DiscoParty party : parent.getParties()){
|
||||
if(party.getSheep().contains((Sheep)e.getEntity())){
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user