summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiBuild/src/com/earth2me/essentials
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsAntiBuild/src/com/earth2me/essentials')
-rw-r--r--EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/AntiBuildConfig.java3
-rw-r--r--EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java10
2 files changed, 12 insertions, 1 deletions
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/AntiBuildConfig.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/AntiBuildConfig.java
index 1aa33d02a..f0cdfcef4 100644
--- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/AntiBuildConfig.java
+++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/AntiBuildConfig.java
@@ -11,7 +11,8 @@ public enum AntiBuildConfig
blacklist_placement("protect.blacklist.placement"),
blacklist_usage("protect.blacklist.usage"),
blacklist_break("protect.blacklist.break"),
- blacklist_piston("protect.blacklist.piston");
+ blacklist_piston("protect.blacklist.piston"),
+ blacklist_dispenser("protect.blacklist.dispenser");
private final String configName;
private final String defValueString;
private final boolean defValueBoolean;
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
index 67995c955..e457f72f2 100644
--- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
+++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
@@ -313,4 +313,14 @@ public class EssentialsAntiBuildListener implements Listener
}
}
}
+
+ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
+ public void onBlockDispense(final BlockDispenseEvent event)
+ {
+ final ItemStack item = event.getItem();
+ if (prot.checkProtectionItems(AntiBuildConfig.blacklist_dispenser, item.getTypeId()))
+ {
+ event.setCancelled(true);
+ }
+ }
}