From f5c6a9f507eeadf65ab4adc309db0a9098e3ba79 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sun, 26 Jun 2011 19:06:07 -0700 Subject: [PATCH] Flames won't appear if you are /god'ed now. --- .../bukkit/WorldGuardEntityListener.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 4e328b0d..cd9d9ac3 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -73,6 +73,7 @@ public void registerEvents() { PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("ENTITY_DAMAGE", Priority.High); + registerEvent("ENTITY_COMBUST", Priority.High); registerEvent("ENTITY_EXPLODE", Priority.High); registerEvent("CREATURE_SPAWN", Priority.High); registerEvent("ENTITY_INTERACT", Priority.High); @@ -403,6 +404,29 @@ public void onEntityDamage(EntityDamageEvent event) { } } + /** + * Called on entity combust. + */ + @Override + public void onEntityCombust(EntityCombustEvent event) { + if (event.isCancelled()) { + return; + } + + Entity entity = event.getEntity(); + + ConfigurationManager cfg = plugin.getGlobalStateManager(); + + if (entity instanceof Player) { + Player player = (Player) entity; + + if (cfg.hasGodMode(player)) { + event.setCancelled(true); + return; + } + } + } + /** * Called on entity explode. */