Added config option to ignore hoppers moving items.

Defaults to old behavior (false).
This commit is contained in:
wizjany 2017-10-14 14:41:58 -04:00
parent f76259df82
commit 95b88ea64b
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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) {