mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-13 19:51:46 +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 disableObsidianGenerators;
|
||||||
public boolean strictEntitySpawn;
|
public boolean strictEntitySpawn;
|
||||||
public TargetMatcherSet allowAllInteract;
|
public TargetMatcherSet allowAllInteract;
|
||||||
|
public boolean ignoreHopperMoveEvents;
|
||||||
public TargetMatcherSet blockUseAtFeet;
|
public TargetMatcherSet blockUseAtFeet;
|
||||||
private Map<String, Integer> maxRegionCounts;
|
private Map<String, Integer> maxRegionCounts;
|
||||||
|
|
||||||
@ -352,6 +352,7 @@ private void loadConfiguration() {
|
|||||||
strictEntitySpawn = getBoolean("event-handling.block-entity-spawns-with-untraceable-cause", false);
|
strictEntitySpawn = getBoolean("event-handling.block-entity-spawns-with-untraceable-cause", false);
|
||||||
allowAllInteract = getTargetMatchers("event-handling.interaction-whitelist");
|
allowAllInteract = getTargetMatchers("event-handling.interaction-whitelist");
|
||||||
blockUseAtFeet = getTargetMatchers("event-handling.emit-block-use-at-feet");
|
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);
|
itemDurability = getBoolean("protection.item-durability", true);
|
||||||
removeInfiniteStacks = getBoolean("protection.remove-infinite-stacks", false);
|
removeInfiniteStacks = getBoolean("protection.remove-infinite-stacks", false);
|
||||||
|
@ -794,6 +794,10 @@ public void onInventoryMoveItem(InventoryMoveItemEvent event) {
|
|||||||
InventoryHolder sourceHolder = event.getSource().getHolder();
|
InventoryHolder sourceHolder = event.getSource().getHolder();
|
||||||
InventoryHolder targetHolder = event.getDestination().getHolder();
|
InventoryHolder targetHolder = event.getDestination().getHolder();
|
||||||
|
|
||||||
|
if (causeHolder instanceof Hopper && getPlugin().getGlobalStateManager().get(((Hopper) causeHolder).getWorld()).ignoreHopperMoveEvents) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Entry entry;
|
Entry entry;
|
||||||
|
|
||||||
if ((entry = moveItemDebounce.tryDebounce(event)) != null) {
|
if ((entry = moveItemDebounce.tryDebounce(event)) != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user