mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-26 02:57:42 +01:00
Added config option to ignore hoppers moving items.
Defaults to old behavior (false).
This commit is contained in:
parent
f76259df82
commit
95b88ea64b
@ -183,7 +183,7 @@ public class WorldConfiguration {
|
||||
public boolean disableObsidianGenerators;
|
||||
public boolean strictEntitySpawn;
|
||||
public TargetMatcherSet allowAllInteract;
|
||||
|
||||
public boolean ignoreHopperMoveEvents;
|
||||
public TargetMatcherSet blockUseAtFeet;
|
||||
private Map<String, Integer> 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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user