fixed anti-breeding
This commit is contained in:
parent
8acf96fc34
commit
e23a269b8c
@ -14,11 +14,11 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
|||||||
*
|
*
|
||||||
* @author Mauve
|
* @author Mauve
|
||||||
*/
|
*/
|
||||||
public class SheepDeshearer implements Listener {
|
public class BaaBaaBlockSheepEvents implements Listener {
|
||||||
|
|
||||||
DiscoSheep parent;
|
DiscoSheep parent;
|
||||||
|
|
||||||
public SheepDeshearer(DiscoSheep parent) {
|
public BaaBaaBlockSheepEvents(DiscoSheep parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ public class SheepDeshearer implements Listener {
|
|||||||
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,6 +55,7 @@ public class DiscoParty {
|
|||||||
newSheep.setHealth(10000);
|
newSheep.setHealth(10000);
|
||||||
newSheep.setColor(discoColours[(int) Math.round(Math.random() * (discoColours.length - 1))]);
|
newSheep.setColor(discoColours[(int) Math.round(Math.random() * (discoColours.length - 1))]);
|
||||||
newSheep.setTarget(player);
|
newSheep.setTarget(player);
|
||||||
|
newSheep.setAgeLock(true);
|
||||||
getSheep().add(newSheep);
|
getSheep().add(newSheep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +101,7 @@ public class DiscoParty {
|
|||||||
if(this.state%3 == 0){
|
if(this.state%3 == 0){
|
||||||
player.playSound(player.getLocation(), Sound.NOTE_STICKS, 1.0f, 1.0f);
|
player.playSound(player.getLocation(), Sound.NOTE_STICKS, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
player.playSound(player.getLocation(), Sound.BURP, frequency, (float) Math.random() + 1);
|
player.playSound(player.getLocation(), Sound.BURP, 0.5f, (float) Math.random() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
|
@ -10,8 +10,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
public final class DiscoSheep extends JavaPlugin {
|
public final class DiscoSheep extends JavaPlugin {
|
||||||
|
|
||||||
Map<String, DiscoParty> parties = new HashMap<String, DiscoParty>();
|
Map<String, DiscoParty> parties = new HashMap<String, DiscoParty>();
|
||||||
private SheepDeshearer deshear = new SheepDeshearer(this);
|
private BaaBaaBlockSheepEvents deshear = new BaaBaaBlockSheepEvents(this);
|
||||||
// array of accetable disco colours (order not important)
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
Loading…
Reference in New Issue
Block a user