Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ItemStack transferStackInSlot(@Nonnull PlayerEntity playerIn, int index) {
- ItemStack itemstack = ItemStack.EMPTY;
- Slot slot = this.inventorySlots.get(index);
- if (slot != null && slot.getHasStack()) {
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
- if (index <= 1) {
- if (!this.mergeItemStack(itemstack1, 2, inventorySlots.size(), true)) {
- return ItemStack.EMPTY;
- }
- } else if (!this.mergeItemStack(itemstack1, 0, 2, false)) {
- return ItemStack.EMPTY;
- }
- if (itemstack1.isEmpty()) {
- slot.putStack(ItemStack.EMPTY);
- } else {
- slot.onSlotChanged();
- }
- }
- return itemstack;
- }
Advertisement
Add Comment
Please, Sign In to add comment