Mob damage setting/flag blocks poison DoT

This commit is contained in:
Wizjany 2013-01-11 19:07:58 -05:00
parent d5afb76105
commit f94c4ec831

View File

@ -428,6 +428,25 @@ public void onEntityDamage(EntityDamageEvent event) {
return;
}
if (type == DamageCause.WITHER) {
// wither boss DoT tick
if (wcfg.disableMobDamage) {
event.setCancelled(true);
return;
}
if (wcfg.useRegions) {
Vector pt = toVector(defender.getLocation());
RegionManager mgr = plugin.getGlobalRegionManager().get(player.getWorld());
ApplicableRegionSet set = mgr.getApplicableRegions(pt);
if (!set.allows(DefaultFlag.MOB_DAMAGE, plugin.wrapPlayer(player))) {
event.setCancelled(true);
return;
}
}
}
if (type == DamageCause.DROWNING && cfg.hasAmphibiousMode(player)) {
player.setRemainingAir(player.getMaximumAir());
event.setCancelled(true);