Skip to content

Commit

Permalink
Reverted commit 79b150d due to an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
H0Imes committed Nov 19, 2024
1 parent 79b150d commit 5993588
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,22 @@ public Container getPlayerInventory() {
}

@Override
public @NotNull ItemStack quickMoveStack(@NotNull Player player, int index) {
public ItemStack quickMoveStack(Player playerIn, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = this.slots.get(index);

if (slot.hasItem()) {
if (slot != null && slot.hasItem()) {
ItemStack stack = slot.getItem();
itemstack = stack.copy();

// Check if the clicked slot is in the main inventory (top-left to bottom-right processing)
if (index < this.getContentsSize()) {
// Move from container inventory to player inventory
if (!this.moveItemStackTo(stack, this.getContentsSize(), this.slots.size(), false)) {
return ItemStack.EMPTY;
}
} else {
// Move from player inventory to container inventory
if (!this.moveItemStackTo(stack, 0, this.getContentsSize(), false)) {
if (!this.moveItemStackTo(stack, this.getContentsSize(), this.slots.size(), true)) {
return ItemStack.EMPTY;
}
} else if (!this.moveItemStackTo(stack, 0, this.getContentsSize(), false)) {
return ItemStack.EMPTY;
}

// Handle emptying or updating the slot
if (stack.isEmpty()) {
slot.set(ItemStack.EMPTY);
} else {
Expand Down

0 comments on commit 5993588

Please sign in to comment.