ironbarrels/src/main/java/cpw/mods/ironchest/ValidatingSlot.java

23 lines
576 B
Java
Raw Normal View History

2013-09-16 19:43:32 +02:00
package cpw.mods.ironchest;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
2016-03-21 17:44:27 +01:00
public class ValidatingSlot extends Slot
{
2013-09-16 19:43:32 +02:00
private IronChestType type;
public ValidatingSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type)
2013-09-16 19:43:32 +02:00
{
super(inventoryIn, slotIndex, xPosition, yPosition);
2013-09-16 19:43:32 +02:00
this.type = type;
}
@Override
public boolean isItemValid(ItemStack par1ItemStack)
{
2016-03-21 17:44:27 +01:00
return this.type.acceptsStack(par1ItemStack);
2013-09-16 19:43:32 +02:00
}
}