File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/pro/cloudnode/smp/bankaccounts/events Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,13 @@ public void onInventoryClick(final @NotNull InventoryDragEvent event) {
161161 */
162162 @ EventHandler (priority = EventPriority .HIGHEST )
163163 public void posItemsChangeWhileOpened (final @ NotNull InventoryMoveItemEvent event ) {
164- final @ NotNull Inventory inventory = event .getSource ();
164+ final @ NotNull Inventory source = event .getSource ();
165+ final @ NotNull Inventory destination = event .getDestination ();
165166 for (final @ NotNull POS pos : POS .activePosChestGuis .values ()) {
166167 final @ Nullable Chest chest = pos .getChest ();
167168 if (chest == null ) continue ;
168- if (inventory .equals (chest .getInventory ())) {
169+ final @ NotNull Inventory chestInventory = chest .getInventory ();
170+ if (source .equals (chestInventory ) || destination .equals (chestInventory )) {
169171 event .setCancelled (true );
170172 return ;
171173 }
You can’t perform that action at this time.
0 commit comments