mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-24 16:31:38 +01:00
Exclude players from mob griefing
This commit is contained in:
parent
105e5be768
commit
094228501b
@ -58,15 +58,16 @@ public class MobGriefingPermission extends ListeningPermission {
|
||||
|
||||
@PermissionHandler
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Player)
|
||||
&& (!(event.getDamager() instanceof org.bukkit.entity.Projectile)
|
||||
|| !(((org.bukkit.entity.Projectile) event.getDamager()).getShooter() instanceof Player))
|
||||
&& !(event.getDamager() instanceof TNTPrimed)
|
||||
&& !(event.getDamager() instanceof ExplosiveMinecart)
|
||||
&& !(event.getDamager() instanceof IronGolem)
|
||||
&& !(event.getDamager() instanceof Snowman)
|
||||
&& !(event.getDamager() instanceof Wolf &&
|
||||
((Wolf) event.getDamager()).isTamed())) {
|
||||
if (!(event.getDamager() instanceof Player) &&
|
||||
(!(event.getDamager() instanceof org.bukkit.entity.Projectile) ||
|
||||
!(((org.bukkit.entity.Projectile) event.getDamager()).getShooter() instanceof Player)) &&
|
||||
!(event.getDamager() instanceof TNTPrimed) &&
|
||||
!(event.getDamager() instanceof ExplosiveMinecart) &&
|
||||
!(event.getDamager() instanceof IronGolem) &&
|
||||
!(event.getDamager() instanceof Snowman) &&
|
||||
!(event.getDamager() instanceof Wolf &&
|
||||
((Wolf) event.getDamager()).isTamed()) &&
|
||||
!(event.getEntity() instanceof Player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user