mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-12-02 13:33:31 +01:00
Fixed InventoryMoveItemEvent still processing if both hopper & item transactions are disabled
This commit is contained in:
parent
3742e018c4
commit
a61df070e6
@ -316,6 +316,11 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||||||
return;
|
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);
|
InventoryHolder sourceHolder = PaperAdapter.ADAPTER.getHolder(event.getSource(), false);
|
||||||
if (sourceHolder == null) {
|
if (sourceHolder == null) {
|
||||||
return;
|
return;
|
||||||
@ -326,7 +331,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.getConfig(location.getWorld()).HOPPER_TRANSACTIONS) {
|
if (hopperTransactions) {
|
||||||
if (Validate.isHopper(destinationHolder) && (Validate.isContainer(sourceHolder) && !Validate.isHopper(sourceHolder))) {
|
if (Validate.isHopper(destinationHolder) && (Validate.isContainer(sourceHolder) && !Validate.isHopper(sourceHolder))) {
|
||||||
HopperPullListener.processHopperPull(location, sourceHolder, destinationHolder, event.getItem());
|
HopperPullListener.processHopperPull(location, sourceHolder, destinationHolder, event.getItem());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user