blocked all sheep damage
This commit is contained in:
parent
bf698d4c6e
commit
6166c56f9c
@ -7,6 +7,7 @@ package gibstick.bukkit.discosheep;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
/**
|
||||
@ -31,4 +32,19 @@ public class BaaBaaBlockSheepEvents implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// actually make sheep invincible
|
||||
@EventHandler
|
||||
public void onEntityDamageEvent(EntityDamageEvent e) {
|
||||
if (e.getEntity() instanceof Sheep) {
|
||||
for (DiscoParty party : parent.getParties()) {
|
||||
if (party.getSheep().contains((Sheep) e.getEntity())) {
|
||||
{
|
||||
party.jumpSheep((Sheep) e.getEntity());
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user