Skip to content

Commit

Permalink
fix container shift clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Aug 23, 2024
1 parent 73cd94d commit b20a0a2
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b20a0a2

Please sign in to comment.