From fb90b1446f19c52fbb11ee3d303d4e49d3b441e0 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sun, 8 Jan 2017 14:22:20 -0500 Subject: [PATCH] Move fireworks to their own flag ("firework-damage"). --- .../sk89q/worldguard/bukkit/listener/RegionFlagsListener.java | 2 +- .../com/sk89q/worldguard/protection/flags/DefaultFlag.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/RegionFlagsListener.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/RegionFlagsListener.java index 59177b0b..4befdb85 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/RegionFlagsListener.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/RegionFlagsListener.java @@ -124,7 +124,7 @@ public void onEntityDamage(EntityDamageEvent event) { if (event instanceof EntityDamageByEntityEvent) { Entity damager = (((EntityDamageByEntityEvent) event)).getDamager(); if (damager != null && damager.getType() == EntityType.FIREWORK) { - if (!query.testState(entity.getLocation(), (RegionAssociable) null, DefaultFlag.OTHER_EXPLOSION)) { + if (!query.testState(entity.getLocation(), (RegionAssociable) null, DefaultFlag.FIREWORK_DAMAGE)) { event.setCancelled(true); return; } diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java index 1dec823b..e1c08da2 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java @@ -73,6 +73,7 @@ public final class DefaultFlag { public static final StateFlag CREEPER_EXPLOSION = new StateFlag("creeper-explosion", true); public static final StateFlag ENDERDRAGON_BLOCK_DAMAGE = new StateFlag("enderdragon-block-damage", true); public static final StateFlag GHAST_FIREBALL = new StateFlag("ghast-fireball", true); + public static final StateFlag FIREWORK_DAMAGE = new StateFlag("firework-damage", true); public static final StateFlag OTHER_EXPLOSION = new StateFlag("other-explosion", true); public static final StateFlag FIRE_SPREAD = new StateFlag("fire-spread", true); public static final StateFlag LAVA_FIRE = new StateFlag("lava-fire", true); @@ -145,7 +146,7 @@ public final class DefaultFlag { public static final Flag[] flagsList = new Flag[] { PASSTHROUGH, BUILD, BLOCK_BREAK, BLOCK_PLACE, PVP, CHEST_ACCESS, PISTONS, TNT, LIGHTER, RIDE, USE, INTERACT, PLACE_VEHICLE, DESTROY_VEHICLE, DAMAGE_ANIMALS, SLEEP, - MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS, + MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS, FIREWORK_DAMAGE, CREEPER_EXPLOSION, OTHER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD, DENY_MESSAGE, ENTRY_DENY_MESSAGE, EXIT_DENY_MESSAGE, EXIT_OVERRIDE, EXIT_VIA_TELEPORT, GREET_MESSAGE, FAREWELL_MESSAGE, NOTIFY_ENTER, NOTIFY_LEAVE,