Fixed InventoryMoveItemEvent still processing if both hopper & item transactions are disabled

This commit is contained in:
Intelli 2021-10-16 16:05:39 -06:00
parent 3742e018c4
commit a61df070e6

View File

@ -316,6 +316,11 @@ public final class InventoryChangeListener extends Queue implements Listener {
return;
}
boolean hopperTransactions = Config.getConfig(location.getWorld()).HOPPER_TRANSACTIONS;
if (!hopperTransactions && !Config.getConfig(location.getWorld()).ITEM_TRANSACTIONS) {
return;
}
InventoryHolder sourceHolder = PaperAdapter.ADAPTER.getHolder(event.getSource(), false);
if (sourceHolder == null) {
return;
@ -326,7 +331,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
return;
}
if (Config.getConfig(location.getWorld()).HOPPER_TRANSACTIONS) {
if (hopperTransactions) {
if (Validate.isHopper(destinationHolder) && (Validate.isContainer(sourceHolder) && !Validate.isHopper(sourceHolder))) {
HopperPullListener.processHopperPull(location, sourceHolder, destinationHolder, event.getItem());
}