From b20a0a2091158537b01bac84ec3d8df238cff9a5 Mon Sep 17 00:00:00 2001 From: Up Date: Fri, 23 Aug 2024 06:56:42 +0200 Subject: [PATCH] fix container shift clicking --- .../common/container/base/SoulContainerMenu.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/traverse/bhc/common/container/base/SoulContainerMenu.java b/src/main/java/com/traverse/bhc/common/container/base/SoulContainerMenu.java index 72f9c23a..127f3b25 100644 --- a/src/main/java/com/traverse/bhc/common/container/base/SoulContainerMenu.java +++ b/src/main/java/com/traverse/bhc/common/container/base/SoulContainerMenu.java @@ -41,7 +41,7 @@ public SoulContainerMenu(@Nullable MenuType menuType, int containerId, Invent this.itemStackHandler = InventoryUtil.createVirtualInventory(slotCount, stack); this.slotCount = slotCount; - if(!stack.is(getContainerItem())) { + if (!stack.is(getContainerItem())) { LOGGER.error("Item in slot {} of player {} was not of expected type, closing menu!", containerSlotId, playerInventory.player.getGameProfile().getName()); playerInventory.player.closeContainer(); } @@ -100,16 +100,18 @@ public ItemStack quickMoveStack(Player playerIn, int index) { ItemStack slotStack = slot.getItem(); stack = slotStack.copy(); if (index < this.itemStackHandler.getSlots()) { - if (!this.moveItemStackTo(slotStack, this.itemStackHandler.getSlots(), this.slots.size(), true)) - ; - return ItemStack.EMPTY; + if (!this.moveItemStackTo(slotStack, this.itemStackHandler.getSlots(), this.slots.size(), true)) { + return ItemStack.EMPTY; + } } else if (!this.moveItemStackTo(slotStack, 0, this.itemStackHandler.getSlots(), false)) { return ItemStack.EMPTY; } - if (slotStack.isEmpty()) + if (slotStack.isEmpty()) { slot.set(ItemStack.EMPTY); - else + } + else { slot.setChanged(); + } } return stack; }