Created
May 21, 2014 09:26
-
-
Save Unh0lyTigg/a8ec4eedca824ef3a1ab to your computer and use it in GitHub Desktop.
Container.transferStackInSlot(EntityPlayer, int)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { | |
ItemStack itemstack = null; | |
Slot slot = (Slot)this.inventorySlots.get(par2); | |
if (slot != null && slot.getHasStack()) { | |
ItemStack itemstack1 = slot.getStack(); | |
itemstack = itemstack1.copy(); | |
if (par2 < this.tile.getSizeInventory()) | |
if (!this.mergeItemStack(itemstack1, this.tile.getSizeInventory(), this.inventorySlots.size(), true)) | |
return null; | |
else if (!this.mergeItemStack(itemstack1, 0, this.tile.getSizeInventory(), false)) | |
return null; | |
if (itemstack1.stackSize == 0) | |
slot.putStack((ItemStack)null); | |
else | |
slot.onSlotChanged(); | |
} | |
return itemstack; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment