blob: 35725b62c42d88d80d9d2c0798afa4ccb45693b4 [file] [log] [blame] [raw]
package li.cil.oc.integration.opencomputers
import li.cil.oc.Constants
import li.cil.oc.api
import li.cil.oc.api.driver.EnvironmentAware
import li.cil.oc.api.driver.EnvironmentHost
import li.cil.oc.api.driver.item.HostAware
import li.cil.oc.api.internal.Robot
import li.cil.oc.common.Slot
import li.cil.oc.common.Tier
import li.cil.oc.server.component
import net.minecraft.item.ItemStack
object DriverUpgradeCrafting extends Item with HostAware with EnvironmentAware {
override def worksWith(stack: ItemStack) = isOneOf(stack,
api.Items.get(Constants.ItemName.CraftingUpgrade))
override def createEnvironment(stack: ItemStack, host: EnvironmentHost) =
host match {
case robot: EnvironmentHost with Robot => new component.UpgradeCrafting(robot)
case _ => null
}
override def slot(stack: ItemStack) = Slot.Upgrade
override def tier(stack: ItemStack) = Tier.Two
override def providedEnvironment(stack: ItemStack) = classOf[component.UpgradeCrafting]
}