mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-11 02:47:33 +01:00
Check creeper-explosion flag for all entity damage, not just players.
This commit is contained in:
parent
1c3cf02ebd
commit
cb9ab3a7b2
@ -64,6 +64,7 @@
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Dispenser;
|
||||
import org.bukkit.entity.AreaEffectCloud;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
@ -788,6 +789,8 @@ public void onEntityDamage(EntityDamageEvent event) {
|
||||
final DamageEntityEvent eventToFire = new DamageEntityEvent(event, create(damager), event.getEntity());
|
||||
if (damager instanceof Firework) {
|
||||
eventToFire.getRelevantFlags().add(Flags.FIREWORK_DAMAGE);
|
||||
} else if (damager instanceof Creeper) {
|
||||
eventToFire.getRelevantFlags().add(Flags.CREEPER_EXPLOSION);
|
||||
}
|
||||
Events.fireToCancel(event, eventToFire);
|
||||
|
||||
|
@ -282,13 +282,6 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (attacker instanceof Creeper) {
|
||||
if (!set.testState(localPlayer, Flags.CREEPER_EXPLOSION) && wcfg.explosionFlagCancellation) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user