Apply other-explosion flag to entity damage as well.

This commit is contained in:
wizjany 2013-04-09 17:18:33 -04:00
parent 874248f8b5
commit 865b94006a

View File

@ -192,7 +192,19 @@ private void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
return;
}
if (wcfg.disableExplosionDamage && type == DamageCause.BLOCK_EXPLOSION) {
if (type == DamageCause.BLOCK_EXPLOSION
&& (wcfg.disableExplosionDamage || wcfg.blockOtherExplosions
|| !plugin.getGlobalRegionManager().allows(DefaultFlag.OTHER_EXPLOSION, player.getLocation()))) {
event.setCancelled(true);
return;
}
} else {
// for whatever reason, plugin-caused explosions with a null entity count as block explosions and aren't
// handled anywhere else
if (type == DamageCause.BLOCK_EXPLOSION
&& (wcfg.blockOtherExplosions
|| !plugin.getGlobalRegionManager().allows(DefaultFlag.OTHER_EXPLOSION, defender.getLocation()))) {
event.setCancelled(true);
return;
}