Skip to content

Commit

Permalink
fix(container): stop crashing on shift click
Browse files Browse the repository at this point in the history
  • Loading branch information
danorris709 committed Oct 26, 2022
1 parent 7ff2d27 commit 26015c2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import net.minecraft.util.Util;
import net.minecraft.util.text.StringTextComponent;

import java.lang.annotation.Target;

@Command(
value = "refresh",
description = "Re-checks a player's vault limit"
Expand Down
25 changes: 25 additions & 0 deletions forge16/src/main/java/com/envyful/vaults/player/PlayerVault.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,30 @@ private void handleClose(PlayerEntity playerIn) {

this.vault.items = items;
}

@Override
public ItemStack quickMoveStack(PlayerEntity p_82846_1_, int p_82846_2_) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = this.slots.get(p_82846_2_);
if (slot != null && slot.hasItem()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.copy();
if (p_82846_2_ < 6 * 9) {
if (!this.moveItemStackTo(itemstack1, 6 * 9, this.slots.size(), true)) {
return ItemStack.EMPTY;
}
} else if (!this.moveItemStackTo(itemstack1, 0, 6 * 9, false)) {
return ItemStack.EMPTY;
}

if (itemstack1.isEmpty()) {
slot.set(ItemStack.EMPTY);
} else {
slot.setChanged();
}
}

return itemstack;
}
}
}

0 comments on commit 26015c2

Please sign in to comment.