Guest User

Untitled

a guest
Jun 5th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package fr.rissalfa.slimemod.objects.blocks.machines.slots;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.inventory.IInventory;
  5. import net.minecraft.inventory.Slot;
  6. import net.minecraft.item.ItemStack;
  7.  
  8. /**
  9. * Created by RissCrew on 03/06/2018.
  10. */
  11. public class SlotMachineOutput extends Slot
  12. {
  13. private final EntityPlayer player;
  14. private int removeCount;
  15.  
  16. public SlotMachineOutput(EntityPlayer player, IInventory inventory, int index, int x, int y) {
  17. super(inventory, index, x, y);
  18. this.player = player;
  19. }
  20.  
  21. @Override
  22. public boolean isItemValid(ItemStack stack)
  23. {
  24. return false;
  25. }
  26.  
  27. @Override
  28. public ItemStack onTake(EntityPlayer thePlayer, ItemStack stack)
  29. {
  30. this.onCrafting(stack);
  31. super.onTake(thePlayer, stack);
  32. return stack;
  33. }
  34.  
  35. @Override
  36. public ItemStack decrStackSize(int amount)
  37. {
  38. if (this.getHasStack()) this.removeCount += Math.min(amount, this.getStack().getCount());
  39. return super.decrStackSize(amount);
  40. }
  41. }
Add Comment
Please, Sign In to add comment