diff options
author | snowleo <schneeleo@gmail.com> | 2011-07-06 01:24:54 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-07-06 01:24:54 +0200 |
commit | c2936186f8ca326659bf7a0b985603c5231a8dc7 (patch) | |
tree | ae1f52961d94d1cf48386334a3434866ee8f6229 /EssentialsProtect/src/com | |
parent | 5006c68af201857583c3097554713a9fa497d1a8 (diff) | |
download | Essentials-c2936186f8ca326659bf7a0b985603c5231a8dc7.tar Essentials-c2936186f8ca326659bf7a0b985603c5231a8dc7.tar.gz Essentials-c2936186f8ca326659bf7a0b985603c5231a8dc7.tar.lz Essentials-c2936186f8ca326659bf7a0b985603c5231a8dc7.tar.xz Essentials-c2936186f8ca326659bf7a0b985603c5231a8dc7.zip |
Now fireball explosion prevention has it's own config settings (was catched by tnt explosion prevention before)
Diffstat (limited to 'EssentialsProtect/src/com')
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java | 10 | ||||
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index f66302ffc..f8166b1d5 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -13,7 +13,9 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.craftbukkit.entity.CraftFireball;
import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.craftbukkit.entity.CraftTNTPrimed;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@@ -221,12 +223,18 @@ public class EssentialsProtectEntityListener extends EntityListener event.setCancelled(true);
return;
}
- else if (!(event.getEntity() instanceof LivingEntity)
+ else if (event.getEntity() instanceof CraftTNTPrimed
&& prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
{
event.setCancelled(true);
return;
}
+ else if (event.getEntity() instanceof CraftFireball
+ && prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
+ {
+ event.setCancelled(true);
+ return;
+ }
// This code will prevent explosions near protected rails, signs or protected chests
// TODO: Use protect db instead of this code
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java index d9161bda8..75824c368 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java @@ -31,6 +31,7 @@ public enum ProtectConfig prevent_portal_creation("protect.prevent.portal-creation", false), prevent_block_on_rail("protect.protect.prevent-block-on-rails", false), prevent_tnt_explosion("protect.prevent.tnt-explosion", false), + prevent_fireball_explosion("protect.prevent.fireball-explosion", false), prevent_creeper_explosion("protect.prevent.creeper-explosion", true), prevent_creeper_playerdmg("protect.prevent.creeper-playerdamage", false), prevent_creeper_blockdmg("protect.prevent.creeper-blockdamage", false), |