summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/com/earth2me/essentials
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-18 02:30:05 +0200
committersnowleo <schneeleo@gmail.com>2011-07-18 02:30:05 +0200
commitcd4c21378c9d05f92e2feb7d288c216bbf4edda2 (patch)
tree670f2db54116e69c9fe4a0b6aff8e5a5a58a3ae4 /EssentialsProtect/src/com/earth2me/essentials
parentf5f04b032a48e3bfc9e4d377443d7759367742f7 (diff)
downloadEssentials-cd4c21378c9d05f92e2feb7d288c216bbf4edda2.tar
Essentials-cd4c21378c9d05f92e2feb7d288c216bbf4edda2.tar.gz
Essentials-cd4c21378c9d05f92e2feb7d288c216bbf4edda2.tar.lz
Essentials-cd4c21378c9d05f92e2feb7d288c216bbf4edda2.tar.xz
Essentials-cd4c21378c9d05f92e2feb7d288c216bbf4edda2.zip
Split build and use protection
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java16
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java3
2 files changed, 17 insertions, 2 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
index aefb6bfe6..7543a5244 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
@@ -7,6 +7,7 @@ import org.bukkit.event.player.PlayerListener;
import org.bukkit.inventory.ItemStack;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Material;
import org.bukkit.event.block.Action;
@@ -30,7 +31,20 @@ public class EssentialsProtectPlayerListener extends PlayerListener
}
final User user = ess.getUser(event.getPlayer());
- if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
+ if (event.hasItem()
+ && (event.getItem().getType() == Material.WATER_BUCKET
+ || event.getItem().getType() == Material.LAVA_BUCKET)
+ && prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
+ {
+ if (ess.getSettings().warnOnBuildDisallow())
+ {
+ user.sendMessage(Util.i18n("buildAlert"));
+ }
+ event.setCancelled(true);
+ return;
+ }
+
+ if (prot.getSettingBool(ProtectConfig.disable_use) && !user.canBuild())
{
if (ess.getSettings().warnOnBuildDisallow())
{
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
index 950da0ebf..12b7c9fd9 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
@@ -10,7 +10,8 @@ public enum ProtectConfig
memstore("protect.memstore", false),
disable_contactdmg("protect.disable.contactdmg", false),
disable_lavadmg("protect.disable.lavadmg", false),
- disable_build("protect.disable.build", false),
+ disable_build("protect.disable.build", true),
+ disable_use("protect.disable.use", true),
disable_pvp("protect.disable.pvp", false),
disable_projectiles("protect.disable.projectiles", false),
disable_fall("protect.disable.fall", false),