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 | ef4a3df1687472bffcffd4922d232d7ee3cd53a2 (patch) | |
tree | 80258e7bdc4f7012549dfaaa2904ca05caa071ae /EssentialsProtect/src/com/earth2me/essentials | |
parent | 4a2a8f2ce0e762d3ee6adeb1b33db6aaeff7bd02 (diff) | |
download | Essentials-ef4a3df1687472bffcffd4922d232d7ee3cd53a2.tar Essentials-ef4a3df1687472bffcffd4922d232d7ee3cd53a2.tar.gz Essentials-ef4a3df1687472bffcffd4922d232d7ee3cd53a2.tar.lz Essentials-ef4a3df1687472bffcffd4922d232d7ee3cd53a2.tar.xz Essentials-ef4a3df1687472bffcffd4922d232d7ee3cd53a2.zip |
Now fireball explosion prevention has it's own config settings (was catched by tnt explosion prevention before)
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials')
-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), |