diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java index 9e99d29e..ebfc12ce 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java @@ -167,6 +167,19 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) { } } + if (attacker.getType() == Entities.enderCrystalType) { + // this isn't handled elsewhere because ender crystal explosions don't carry a player cause + // in the same way that creepers or tnt can + WorldConfiguration wcfg = plugin.getGlobalStateManager().get(defender.getWorld()); + if (wcfg.useRegions && wcfg.explosionFlagCancellation) { + if (!plugin.getRegionContainer().createQuery().getApplicableRegions(defender.getLocation()) + .testState(null, DefaultFlag.OTHER_EXPLOSION)) { + event.setCancelled(true); + return; + } + } + } + if (defender instanceof Player) { Player player = (Player) defender; LocalPlayer localPlayer = plugin.wrapPlayer(player);