mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +01:00
Mob damage setting/flag blocks poison DoT
This commit is contained in:
parent
d5afb76105
commit
f94c4ec831
@ -428,6 +428,25 @@ public void onEntityDamage(EntityDamageEvent event) {
|
|||||||
return;
|
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)) {
|
if (type == DamageCause.DROWNING && cfg.hasAmphibiousMode(player)) {
|
||||||
player.setRemainingAir(player.getMaximumAir());
|
player.setRemainingAir(player.getMaximumAir());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user