diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 9d6f0bff..693fb03e 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -28,6 +28,8 @@ import com.sk89q.worldguard.protection.regionmanager.RegionManager; import java.util.Iterator; import java.util.List; +import java.util.logging.Logger; + import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.ChatColor; diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index f8b8bbd0..ec305e96 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -18,6 +18,8 @@ */ package com.sk89q.worldguard.bukkit; +import java.util.logging.Logger; + import org.bukkit.event.Event.Priority; import org.bukkit.event.Event; import org.bukkit.plugin.PluginManager; @@ -133,10 +135,20 @@ public void onPlayerItem(PlayerItemEvent event) { Player player = event.getPlayer(); Block block = event.getBlockClicked(); ItemStack item = event.getItem(); + int itemId = item.getTypeId(); WorldGuardConfiguration cfg = plugin.getWgConfiguration(); WorldGuardWorldConfiguration wcfg = cfg.getWorldConfig(player.getWorld().getName()); + + Material type = block.getType(); + + if (wcfg.useRegions && type != Material.LEVER && type != Material.STONE_BUTTON && type != Material.DIODE + && (itemId == 322 || itemId == 320 || itemId == 319 || itemId == 297 || itemId == 260 + || itemId == 350 || itemId == 349 || itemId == 354) ) { + return; + } + if (!wcfg.itemDurability) { // Hoes if (item.getTypeId() >= 290 && item.getTypeId() <= 294) {