diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-11 10:49:45 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-11 10:49:45 +0000 |
commit | 0c0a8b2602ca1c1267dc43b53f992bf2d7155910 (patch) | |
tree | 0754703b2c62ebeef3e347f7eb7baa17e318ca16 | |
parent | 8a30845b1deac3ad834b12b1110f76a4928c419e (diff) | |
download | Essentials-0c0a8b2602ca1c1267dc43b53f992bf2d7155910.tar Essentials-0c0a8b2602ca1c1267dc43b53f992bf2d7155910.tar.gz Essentials-0c0a8b2602ca1c1267dc43b53f992bf2d7155910.tar.lz Essentials-0c0a8b2602ca1c1267dc43b53f992bf2d7155910.tar.xz Essentials-0c0a8b2602ca1c1267dc43b53f992bf2d7155910.zip |
[trunk] Protect: new prevent.portal-creation
If enabled, players can't create portals using fire.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1177 e251c2fe-e539-e718-e476-b85c1f46cddb
3 files changed, 12 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 28dc1f8e9..232e36e65 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -304,6 +304,7 @@ public class Settings implements IConf epSettings.put("protect.prevent.water-bucket-flow", config.getBoolean("protect.prevent.water-bucket-flow", false)); epSettings.put("protect.prevent.fire-spread", config.getBoolean("protect.prevent.fire-spread", false)); epSettings.put("protect.prevent.flint-fire", config.getBoolean("protect.prevent.flint-fire", false)); + epSettings.put("protect.prevent.portal-creation", config.getBoolean("protect.prevent.portal-creation", false)); epSettings.put("protect.prevent.lava-fire-spread", config.getBoolean("protect.prevent.lava-fire-spread", false)); epSettings.put("protect.prevent.tnt-explosion", config.getBoolean("protect.prevent.tnt-explosion", false)); epSettings.put("protect.prevent.creeper-explosion", config.getBoolean("protect.prevent.creeper-explosion", false)); diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 77d505354..b5c2334fe 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -300,6 +300,7 @@ protect: fire-spread: false lava-fire-spread: false flint-fire: false + portal-creation: false tnt-explosion: false creeper-explosion: false creeper-playerdamage: false diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index da790e0d5..bd9991f19 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; +import java.util.logging.Level; +import java.util.logging.Logger; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -129,6 +131,14 @@ public class EssentialsProtectBlockListener extends BlockListener event.setCancelled(true); return; } + + if (event.getBlock().getType() == Material.OBSIDIAN || + event.getBlock().getFace(BlockFace.DOWN).getType() == Material.OBSIDIAN) + { + event.setCancelled(EssentialsProtect.guardSettings.get("protect.prevent.portal-creation")); + return; + } + if ((event.getCause().equals(BlockIgniteEvent.IgniteCause.SPREAD))) { event.setCancelled(EssentialsProtect.guardSettings.get("protect.prevent.fire-spread")); |