Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public ItemStack transferStackInSlot(EntityPlayer playerIn, int index){
- ItemStack stack = null;
- Slot slotObject = (Slot) inventorySlots.get(index);
- //null checks and checks if the item can be stacked (maxStackSize > 1)
- if (slotObject != null && slotObject.getHasStack()) {
- ItemStack stackInSlot = slotObject.getStack();
- stack = stackInSlot.copy();
- //merges the item into player inventory since its in the tileEntity
- /*if (slot < tileEntity.getSizeInventory()) {
- if (!this.mergeItemStack(stackInSlot, tileEntity.getSizeInventory(), 36+tileEntity.getSizeInventory(), true)) {
- return null;
- }
- }
- //places it into the tileEntity is possible since its in the player inventory
- else if (!this.mergeItemStack(stackInSlot, 0, tileEntity.getSizeInventory(), false)) {
- return null;
- }*/
- if (stackInSlot.stackSize == 0) {
- slotObject.putStack(null);
- } else {
- slotObject.onSlotChanged();
- }
- if (stackInSlot.stackSize == stack.stackSize) {
- return null;
- }
- slotObject.onPickupFromSlot(playerIn, stackInSlot);
- }
- return stack;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement