Guest User

transferStackInSlot

a guest
Jan 22nd, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. public ItemStack transferStackInSlot(EntityPlayer player, int i)
  2. {
  3. ItemStack itemstack = null;
  4. Slot slot = (Slot)this.inventorySlots.get(i);
  5. Item item = null;
  6. Item item2 = null;
  7.  
  8. if (slot != null && slot.getHasStack()) {
  9. ItemStack itemstack1 = slot.getStack();
  10. itemstack = itemstack1.copy();
  11.  
  12. if (i == 2)
  13. {
  14. if (!this.mergeItemStack(itemstack1, 3, 39, true))
  15. {
  16. return null;
  17. }
  18.  
  19. slot.onSlotChange(itemstack1, itemstack);
  20. }
  21. else if (i != 1 && i != 0)
  22. {
  23. if (IceCreamMakerRecipes.getIceCreamResult(item, item2) != null)
  24. {
  25. if (!this.mergeItemStack(itemstack1, 0, 1, false))
  26. {
  27. return null;
  28. }
  29. }
  30. else if (icemaker.hasItemPower(itemstack1))
  31. {
  32. if (!this.mergeItemStack(itemstack1, 2, 2, false))
  33. {
  34. return null;
  35. }
  36. }
  37. else if (i >= 3 && i < 30)
  38. {
  39. if (!this.mergeItemStack(itemstack1, 30, 39, false))
  40. {
  41. return null;
  42. }
  43. }
  44. else if (i >= 30 && i < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
  45. {
  46. return null;
  47. }
  48. }
  49. else if (!this.mergeItemStack(itemstack1, 3, 39, false))
  50. {
  51. return null;
  52. }
  53.  
  54. if (itemstack1.stackSize == 0)
  55. {
  56. slot.putStack((ItemStack)null);
  57. }
  58. else
  59. {
  60. slot.onSlotChanged();
  61. }
  62.  
  63. if (itemstack1.stackSize == itemstack.stackSize)
  64. {
  65. return null;
  66. }
  67.  
  68. slot.onPickupFromSlot(player, itemstack1);
  69. }
  70.  
  71. return itemstack;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment