Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.rissalfa.slimemod.objects.blocks.machines.slots;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- /**
- * Created by RissCrew on 03/06/2018.
- */
- public class SlotMachineOutput extends Slot
- {
- private final EntityPlayer player;
- private int removeCount;
- public SlotMachineOutput(EntityPlayer player, IInventory inventory, int index, int x, int y) {
- super(inventory, index, x, y);
- this.player = player;
- }
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return false;
- }
- @Override
- public ItemStack onTake(EntityPlayer thePlayer, ItemStack stack)
- {
- this.onCrafting(stack);
- super.onTake(thePlayer, stack);
- return stack;
- }
- @Override
- public ItemStack decrStackSize(int amount)
- {
- if (this.getHasStack()) this.removeCount += Math.min(amount, this.getStack().getCount());
- return super.decrStackSize(amount);
- }
- }
Add Comment
Please, Sign In to add comment