diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java index 6e7b5282..8367f06e 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java @@ -183,7 +183,7 @@ public class WorldConfiguration { public boolean disableObsidianGenerators; public boolean strictEntitySpawn; public TargetMatcherSet allowAllInteract; - + public boolean ignoreHopperMoveEvents; public TargetMatcherSet blockUseAtFeet; private Map maxRegionCounts; @@ -352,6 +352,7 @@ private void loadConfiguration() { strictEntitySpawn = getBoolean("event-handling.block-entity-spawns-with-untraceable-cause", false); allowAllInteract = getTargetMatchers("event-handling.interaction-whitelist"); blockUseAtFeet = getTargetMatchers("event-handling.emit-block-use-at-feet"); + ignoreHopperMoveEvents = getBoolean("event-handling.ignore-hopper-item-move-events", false); itemDurability = getBoolean("protection.item-durability", true); removeInfiniteStacks = getBoolean("protection.remove-infinite-stacks", false); diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java index 3772dd9b..aabafdfb 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java @@ -794,6 +794,10 @@ public void onInventoryMoveItem(InventoryMoveItemEvent event) { InventoryHolder sourceHolder = event.getSource().getHolder(); InventoryHolder targetHolder = event.getDestination().getHolder(); + if (causeHolder instanceof Hopper && getPlugin().getGlobalStateManager().get(((Hopper) causeHolder).getWorld()).ignoreHopperMoveEvents) { + return; + } + Entry entry; if ((entry = moveItemDebounce.tryDebounce(event)) != null) {