blob: 25bbb10ff4a1961afa09812f270d0dd617b9d492 [file] [log] [blame] [raw]
package li.cil.oc.common.tileentity
import li.cil.oc.Config
import li.cil.oc.api.driver.Slot
import li.cil.oc.server.driver.Registry
import net.minecraft.item.ItemStack
class Case(isRemote: Boolean) extends Computer(isRemote) {
def this() = this(false)
// ----------------------------------------------------------------------- //
def getInvName = Config.namespace + "container.Case"
def getSizeInventory = 8
def isItemValidForSlot(slot: Int, item: ItemStack) = (slot, Registry.driverFor(item)) match {
case (_, None) => false // Invalid item.
case (0, Some(driver)) => driver.slot(item) == Slot.Power
case (1 | 2 | 3, Some(driver)) => driver.slot(item) == Slot.Card
case (4 | 5, Some(driver)) => driver.slot(item) == Slot.Memory
case (6 | 7, Some(driver)) => driver.slot(item) == Slot.HardDiskDrive
case _ => false // Invalid slot.
}
}