blob: 678d1d77ceb9710102cd6beecc1b2dc7c83177ed [file] [log] [blame] [raw]
package li.cil.oc.server.drivers
import li.cil.oc.Items
import li.cil.oc.api.{IItemDriver, ComponentType}
import li.cil.oc.common.util.ItemComponentCache
import li.cil.oc.server.components.GraphicsCard
import net.minecraft.item.ItemStack
object GraphicsCardDriver extends IItemDriver {
override def api = Option(getClass.getResourceAsStream("/assets/opencomputers/lua/gpu.lua"))
override def worksWith(item: ItemStack) = item.itemID == Items.multi.itemID && (Items.multi.subItem(item) match {
case None => false
case Some(subItem) => subItem.itemId == Items.gpu.itemId
})
override def componentType(item: ItemStack) = ComponentType.PCI
override def node(item: ItemStack) = ItemComponentCache.get[GraphicsCard](item)
}