2014-12-15 00:11:48 +00:00
|
|
|
package com.cricketcraft.chisel.inventory;
|
2014-04-21 19:13:15 +01:00
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.inventory.Slot;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
|
|
public class SlotChiselInput extends Slot
|
|
|
|
|
{
|
|
|
|
|
public SlotChiselInput(ContainerChisel container, InventoryChiselSelection inv, int i, int j, int k)
|
|
|
|
|
{
|
|
|
|
|
super(inv, i, j, k);
|
|
|
|
|
selInventory = inv;
|
|
|
|
|
this.container = container;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isItemValid(ItemStack itemstack)
|
|
|
|
|
{
|
|
|
|
|
if(container.finished) return false;
|
|
|
|
|
|
|
|
|
|
return super.isItemValid(itemstack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
|
|
|
|
{
|
|
|
|
|
return !container.finished && super.canTakeStack(par1EntityPlayer);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSlotChanged()
|
|
|
|
|
{
|
|
|
|
|
if(container.finished) return;
|
|
|
|
|
|
|
|
|
|
super.onSlotChanged();
|
|
|
|
|
selInventory.updateItems();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContainerChisel container;
|
|
|
|
|
InventoryChiselSelection selInventory;
|
|
|
|
|
}
|