Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8

Conflicts:
	src/main/scala/li/cil/oc/Constants.scala
	src/main/scala/li/cil/oc/CreativeTab.scala
	src/main/scala/li/cil/oc/client/Proxy.scala
	src/main/scala/li/cil/oc/client/renderer/HighlightRenderer.scala
	src/main/scala/li/cil/oc/client/renderer/block/Print.scala
	src/main/scala/li/cil/oc/client/renderer/item/ItemRenderer.scala
	src/main/scala/li/cil/oc/client/renderer/tileentity/RobotRenderer.scala
	src/main/scala/li/cil/oc/common/Achievement.scala
	src/main/scala/li/cil/oc/common/GuiHandler.scala
	src/main/scala/li/cil/oc/common/Loot.scala
	src/main/scala/li/cil/oc/common/PacketHandler.scala
	src/main/scala/li/cil/oc/common/Proxy.scala
	src/main/scala/li/cil/oc/common/block/RobotAfterimage.scala
	src/main/scala/li/cil/oc/common/block/RobotProxy.scala
	src/main/scala/li/cil/oc/common/block/Screen.scala
	src/main/scala/li/cil/oc/common/component/Terminal.scala
	src/main/scala/li/cil/oc/common/component/TextBuffer.scala
	src/main/scala/li/cil/oc/common/entity/Drone.scala
	src/main/scala/li/cil/oc/common/init/Blocks.scala
	src/main/scala/li/cil/oc/common/init/Items.scala
	src/main/scala/li/cil/oc/common/item/Analyzer.scala
	src/main/scala/li/cil/oc/common/item/Delegator.scala
	src/main/scala/li/cil/oc/common/item/Tablet.scala
	src/main/scala/li/cil/oc/common/recipe/Recipes.scala
	src/main/scala/li/cil/oc/common/template/DroneTemplate.scala
	src/main/scala/li/cil/oc/common/template/MicrocontrollerTemplate.scala
	src/main/scala/li/cil/oc/common/template/NavigationUpgradeTemplate.scala
	src/main/scala/li/cil/oc/common/template/RobotTemplate.scala
	src/main/scala/li/cil/oc/common/template/ServerTemplate.scala
	src/main/scala/li/cil/oc/common/template/TabletTemplate.scala
	src/main/scala/li/cil/oc/common/tileentity/Keyboard.scala
	src/main/scala/li/cil/oc/common/tileentity/Microcontroller.scala
	src/main/scala/li/cil/oc/common/tileentity/Switch.scala
	src/main/scala/li/cil/oc/common/tileentity/traits/TextBuffer.scala
	src/main/scala/li/cil/oc/integration/fmp/PrintPart.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverBlockEnvironments.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverCPU.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverComponentBus.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverContainerCard.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverContainerUpgrade.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverGraphicsCard.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverLootDisk.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverMemory.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverRedstoneCard.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverUpgradeBattery.scala
	src/main/scala/li/cil/oc/integration/opencomputers/DriverUpgradeDatabase.scala
	src/main/scala/li/cil/oc/integration/opencomputers/ModOpenComputers.scala
This commit is contained in:
Florian Nücke 2015-04-07 16:04:33 +02:00
commit dda596f1d6
27 changed files with 395 additions and 190 deletions

View File

@ -21,7 +21,7 @@ object OpenComputers {
final val Version = "@VERSION@" final val Version = "@VERSION@"
var log = LogManager.getLogger("OpenComputers") var log = LogManager.getLogger(Name)
@SidedProxy(clientSide = "li.cil.oc.client.Proxy", serverSide = "li.cil.oc.server.Proxy") @SidedProxy(clientSide = "li.cil.oc.client.Proxy", serverSide = "li.cil.oc.server.Proxy")
var proxy: Proxy = null var proxy: Proxy = null

View File

@ -19,6 +19,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer
import net.minecraft.init.Items import net.minecraft.init.Items
import net.minecraft.item.ItemBlock import net.minecraft.item.ItemBlock
import net.minecraft.tileentity.TileEntity import net.minecraft.tileentity.TileEntity
import net.minecraft.util.EnumChatFormatting
import net.minecraft.util.EnumFacing import net.minecraft.util.EnumFacing
import net.minecraft.util.Vec3 import net.minecraft.util.Vec3
import net.minecraftforge.client.IItemRenderer.ItemRenderType import net.minecraftforge.client.IItemRenderer.ItemRenderType
@ -437,7 +438,7 @@ object RobotRenderer extends TileEntitySpecialRenderer {
t.draw t.draw
GL11.glEnable(GL11.GL_TEXTURE_2D) // For the font. GL11.glEnable(GL11.GL_TEXTURE_2D) // For the font.
f.drawString(name, -halfWidth, 0, 0xFFFFFFFF) f.drawString((if (EventHandler.isItTime) EnumChatFormatting.OBFUSCATED.toString else "") + name, -halfWidth, 0, 0xFFFFFFFF)
RenderState.enableDepthMask() RenderState.enableDepthMask()
RenderState.enableLighting() RenderState.enableLighting()

View File

@ -1,6 +1,7 @@
package li.cil.oc.common package li.cil.oc.common
import li.cil.oc.Constants import li.cil.oc.Constants
import li.cil.oc.OpenComputers
import li.cil.oc.api.detail.ItemInfo import li.cil.oc.api.detail.ItemInfo
import li.cil.oc.common.init.Items import li.cil.oc.common.init.Items
import net.minecraft.entity.player.EntityPlayer import net.minecraft.entity.player.EntityPlayer
@ -12,116 +13,306 @@ import net.minecraftforge.common.AchievementPage
import scala.collection.mutable import scala.collection.mutable
object Achievement { object Achievement {
val All = mutable.ArrayBuffer.empty[Achievement] val All = mutable.ArrayBuffer.empty[MCAchievement]
val CraftingMap = mutable.Map.empty[ItemInfo, MCAchievement] val CraftingMap = mutable.Map.empty[ItemInfo, MCAchievement]
val CustomCraftingMap = mutable.Map.empty[ItemStack, MCAchievement]
val AssemblingMap = mutable.Map.empty[ItemInfo, MCAchievement]
val Transistor = new Achievement("oc.transistor", "oc.transistor", val Transistor = newAchievement("transistor").
2, 0, Items.get(Constants.ItemName.Transistor).createItemStack(1), null, Constants.ItemName.Transistor).setIndependent() at(2, 0).
val Disassembler = new Achievement("oc.disassembler", "oc.disassembler", whenCrafting(Constants.ItemName.Transistor).
2, 2, Items.get(Constants.BlockName.Disassembler).createItemStack(1), Transistor, Constants.BlockName.Disassembler) add()
val Microchip = new Achievement("oc.chip", "oc.chip", val Disassembler = newAchievement("disassembler").
4, 0, Items.get(Constants.ItemName.ChipTier1).createItemStack(1), Transistor, Constants.ItemName.ChipTier1, Constants.ItemName.ChipTier2, Constants.ItemName.ChipTier3) at(2, 2).
val Capacitor = new Achievement("oc.capacitor", "oc.capacitor", whenCrafting(Constants.BlockName.Disassembler).
6, -1, Items.get(Constants.BlockName.Capacitor).createItemStack(1), Microchip, Constants.BlockName.Capacitor) withParent(Transistor).
val Assembler = new Achievement("oc.assembler", "oc.assembler", add()
8, -2, Items.get(Constants.BlockName.Assembler).createItemStack(1), Capacitor, Constants.BlockName.Assembler) val Microchip = newAchievement("chip").
val Microcontroller = new Achievement("oc.microcontroller", "oc.microcontroller", at(4, 0).
10, -2, Items.get(Constants.BlockName.Microcontroller).createItemStack(1), Assembler) withParent(Transistor).
val Robot = new Achievement("oc.robot", "oc.robot", whenCrafting(Constants.ItemName.ChipTier1).
10, -3, Items.get(Constants.BlockName.Robot).createItemStack(1), Assembler) whenCrafting(Constants.ItemName.ChipTier2).
val Drone = new Achievement("oc.drone", "oc.drone", whenCrafting(Constants.ItemName.ChipTier3).
10, -4, Items.get(Constants.ItemName.Drone).createItemStack(1), Assembler) add()
val Tablet = new Achievement("oc.tablet", "oc.tablet", val Capacitor = newAchievement("capacitor").
10, -5, Items.get(Constants.ItemName.Tablet).createItemStack(1), Assembler) at(6, -1).
val Charger = new Achievement("oc.charger", "oc.charger", withParent(Microchip).
8, -1, Items.get(Constants.BlockName.Charger).createItemStack(1), Capacitor, Constants.BlockName.Charger) whenCrafting(Constants.BlockName.Capacitor).
val CPU = new Achievement("oc.cpu", "oc.cpu", add()
6, 0, Items.get(Constants.ItemName.CPUTier1).createItemStack(1), Microchip, Constants.ItemName.CPUTier1, Constants.ItemName.CPUTier2, Constants.ItemName.CPUTier3) val Assembler = newAchievement("assembler").
val MotionSensor = new Achievement("oc.motionSensor", "oc.motionSensor", at(8, -2).
8, 0, Items.get(Constants.BlockName.MotionSensor).createItemStack(1), CPU, Constants.BlockName.MotionSensor) withParent(Capacitor).
val Geolyzer = new Achievement("oc.geolyzer", "oc.geolyzer", whenCrafting(Constants.BlockName.Assembler).
8, 1, Items.get(Constants.BlockName.Geolyzer).createItemStack(1), CPU, Constants.BlockName.Geolyzer) add()
val RedstoneIO = new Achievement("oc.redstoneIO", "oc.redstoneIO", val Microcontroller = newAchievement("microcontroller").
8, 2, Items.get(Constants.BlockName.Redstone).createItemStack(1), CPU, Constants.BlockName.Redstone) at(10, -2).
val EEPROM = new Achievement("oc.eeprom", "oc.eeprom", withParent(Assembler).
6, 3, Items.get(Constants.ItemName.EEPROM).createItemStack(1), Microchip, Constants.ItemName.EEPROM) whenAssembling(Constants.BlockName.Microcontroller).
val Memory = new Achievement("oc.ram", "oc.ram", add()
6, 4, Items.get(Constants.ItemName.RAMTier1).createItemStack(1), Microchip, Constants.ItemName.RAMTier1, Constants.ItemName.RAMTier2, Constants.ItemName.RAMTier3, Constants.ItemName.RAMTier4, Constants.ItemName.RAMTier5, Constants.ItemName.RAMTier6) val Robot = newAchievement("robot").
val HDD = new Achievement("oc.hdd", "oc.hdd", at(10, -3).
6, 5, Items.get(Constants.ItemName.HDDTier1).createItemStack(1), Microchip, Constants.ItemName.HDDTier1, Constants.ItemName.HDDTier2, Constants.ItemName.HDDTier3) withParent(Assembler).
val Case = new Achievement("oc.case", "oc.case", whenAssembling(Constants.BlockName.Robot).
6, 6, Items.get(Constants.BlockName.CaseTier1).createItemStack(1), Microchip, Constants.BlockName.CaseTier1, Constants.BlockName.CaseTier2, Constants.BlockName.CaseTier3) add()
val Rack = new Achievement("oc.rack", "oc.rack", val Drone = newAchievement("drone").
8, 6, Items.get(Constants.BlockName.ServerRack).createItemStack(1), Case, Constants.BlockName.ServerRack) at(10, -4).
val Server = new Achievement("oc.server", "oc.server", withParent(Assembler).
10, 6, Items.get(Constants.ItemName.ServerTier1).createItemStack(1), Rack, Constants.ItemName.ServerTier1, Constants.ItemName.ServerTier2, Constants.ItemName.ServerTier3) whenAssembling(Constants.ItemName.Drone).
val Screen = new Achievement("oc.screen", "oc.screen", add()
6, 7, Items.get(Constants.BlockName.ScreenTier1).createItemStack(1), Microchip, Constants.BlockName.ScreenTier1, Constants.BlockName.ScreenTier2, Constants.BlockName.ScreenTier3) val Tablet = newAchievement("tablet").
val Keyboard = new Achievement("oc.keyboard", "oc.keyboard", at(10, -5).
8, 7, Items.get(Constants.BlockName.Keyboard).createItemStack(1), Screen, Constants.BlockName.Keyboard) withParent(Assembler).
val Hologram = new Achievement("oc.hologram", "oc.hologram", whenAssembling(Constants.ItemName.Tablet).
8, 8, Items.get(Constants.BlockName.HologramTier1).createItemStack(1), Screen, Constants.BlockName.HologramTier1, Constants.BlockName.HologramTier2) add()
val DiskDrive = new Achievement("oc.diskDrive", "oc.diskDrive", val Charger = newAchievement("charger").
6, 9, Items.get(Constants.BlockName.DiskDrive).createItemStack(1), Microchip, Constants.BlockName.DiskDrive) at(8, -1).
val Floppy = new Achievement("oc.floppy", "oc.floppy", withParent(Capacitor).
8, 9, Items.get(Constants.ItemName.Floppy).createItemStack(1), DiskDrive, Constants.ItemName.Floppy) whenCrafting(Constants.BlockName.Charger).
val OpenOS = new Achievement("oc.openOS", "oc.openOS", add()
10, 9, Items.createOpenOS(), Floppy) val CPU = newAchievement("cpu").
val Raid = new Achievement("oc.raid", "oc.raid", at(6, 0).
8, 10, Items.get(Constants.BlockName.Raid).createItemStack(1), DiskDrive, Constants.BlockName.Raid) withParent(Microchip).
whenCrafting(Constants.ItemName.CPUTier1).
whenCrafting(Constants.ItemName.CPUTier2).
whenCrafting(Constants.ItemName.CPUTier3).
add()
val MotionSensor = newAchievement("motionSensor").
at(8, 0).
withParent(CPU).
whenCrafting(Constants.BlockName.MotionSensor).
add()
val Geolyzer = newAchievement("geolyzer").
at(8, 1).
withParent(CPU).
whenCrafting(Constants.BlockName.Geolyzer).
add()
val RedstoneIO = newAchievement("redstoneIO").
at(8, 2).
withParent(CPU).
whenCrafting(Constants.BlockName.Redstone).
add()
val EEPROM = newAchievement("eeprom").
at(6, 3).
withParent(Microchip).
whenCrafting(Constants.ItemName.EEPROM).
add()
val Memory = newAchievement("ram").
at(6, 4).
withParent(Microchip).
whenCrafting(Constants.ItemName.RAMTier1).
whenCrafting(Constants.ItemName.RAMTier2).
whenCrafting(Constants.ItemName.RAMTier3).
whenCrafting(Constants.ItemName.RAMTier4).
whenCrafting(Constants.ItemName.RAMTier5).
whenCrafting(Constants.ItemName.RAMTier6).
add()
val HDD = newAchievement("hdd").
at(6, 5).
withParent(Microchip).
whenCrafting(Constants.ItemName.HDDTier1).
whenCrafting(Constants.ItemName.HDDTier2).
whenCrafting(Constants.ItemName.HDDTier3).
add()
val Case = newAchievement("case").
at(6, 6).
withParent(Microchip).
whenCrafting(Constants.BlockName.CaseTier1).
whenCrafting(Constants.BlockName.CaseTier2).
whenCrafting(Constants.BlockName.CaseTier3).
add()
val Rack = newAchievement("rack").
at(8, 6).
withParent(Case).
whenCrafting(Constants.BlockName.ServerRack).
add()
val Server = newAchievement("server").
at(10, 6).
withParent(Rack).
whenCrafting(Constants.ItemName.ServerTier1).
whenCrafting(Constants.ItemName.ServerTier2).
whenCrafting(Constants.ItemName.ServerTier3).
add()
val Screen = newAchievement("screen").
at(6, 7).
withParent(Microchip).
whenCrafting(Constants.BlockName.ScreenTier1).
whenCrafting(Constants.BlockName.ScreenTier2).
whenCrafting(Constants.BlockName.ScreenTier3).
add()
val Keyboard = newAchievement("keyboard").
at(8, 7).
withParent(Screen).
whenCrafting(Constants.BlockName.Keyboard).
add()
val Hologram = newAchievement("hologram").
at(8, 8).
withParent(Screen).
whenCrafting(Constants.BlockName.HologramTier1).
whenCrafting(Constants.BlockName.HologramTier2).
add()
val DiskDrive = newAchievement("diskDrive").
at(6, 9).
withParent(Microchip).
whenCrafting(Constants.BlockName.DiskDrive).
add()
val Floppy = newAchievement("floppy").
at(8, 9).
withParent(DiskDrive).
whenCrafting(Constants.ItemName.Floppy).
add()
val OpenOS = newAchievement("openOS").
at(10, 9).
withParent(Floppy).
whenCrafting(Items.createOpenOS()).
add()
val Raid = newAchievement("raid").
at(8, 10).
withParent(DiskDrive).
whenCrafting(Constants.BlockName.Raid).
add()
val Card = new Achievement("oc.card", "oc.card", val Card = newAchievement("card").
0, -2, Items.get(Constants.ItemName.Card).createItemStack(1), null, Constants.ItemName.Card).setIndependent() at(0, -2).
val RedstoneCard = new Achievement("oc.redstoneCard", "oc.redstoneCard", whenCrafting(Constants.ItemName.Card).
-2, -4, Items.get(Constants.ItemName.RedstoneCardTier1).createItemStack(1), Card, Constants.ItemName.RedstoneCardTier1, Constants.ItemName.RedstoneCardTier2) add()
val GraphicsCard = new Achievement("oc.graphicsCard", "oc.graphicsCard", val RedstoneCard = newAchievement("redstoneCard").
0, -5, Items.get(Constants.ItemName.GraphicsCardTier1).createItemStack(1), Card, Constants.ItemName.GraphicsCardTier1, Constants.ItemName.GraphicsCardTier2, Constants.ItemName.GraphicsCardTier3) at(-2, -4).
val NetworkCard = new Achievement("oc.networkCard", "oc.networkCard", withParent(Card).
2, -4, Items.get(Constants.ItemName.NetworkCard).createItemStack(1), Card, Constants.ItemName.NetworkCard) whenCrafting(Constants.ItemName.RedstoneCardTier1).
val WirelessNetworkCard = new Achievement("oc.wirelessNetworkCard", "oc.wirelessNetworkCard", whenCrafting(Constants.ItemName.RedstoneCardTier2).
2, -6, Items.get(Constants.ItemName.WirelessNetworkCard).createItemStack(1), NetworkCard, Constants.ItemName.WirelessNetworkCard) add()
val GraphicsCard = newAchievement("graphicsCard").
at(0, -5).
withParent(Card).
whenCrafting(Constants.ItemName.GraphicsCardTier1).
whenCrafting(Constants.ItemName.GraphicsCardTier2).
whenCrafting(Constants.ItemName.GraphicsCardTier3).
add()
val NetworkCard = newAchievement("networkCard").
at(2, -4).
withParent(Card).
whenCrafting(Constants.ItemName.NetworkCard).
add()
val WirelessNetworkCard = newAchievement("wirelessNetworkCard").
at(2, -6).
withParent(NetworkCard).
whenCrafting(Constants.ItemName.WirelessNetworkCard).
add()
val Cable = new Achievement("oc.cable", "oc.cable", val Cable = newAchievement("cable").
-2, 0, Items.get(Constants.BlockName.Cable).createItemStack(1), null, Constants.BlockName.Cable).setIndependent() at(-2, 0).
val PowerDistributor = new Achievement("oc.powerDistributor", "oc.powerDistributor", whenCrafting(Constants.BlockName.Cable).
-4, -1, Items.get(Constants.BlockName.PowerDistributor).createItemStack(1), Cable, Constants.BlockName.PowerDistributor) add()
val Switch = new Achievement("oc.switch", "oc.switch", val PowerDistributor = newAchievement("powerDistributor").
-4, 0, Items.get(Constants.BlockName.Switch).createItemStack(1), Cable, "switch", Constants.BlockName.Switch) at(-4, -1).
val Adapter = new Achievement("oc.adapter", "oc.adapter", withParent(Cable).
-4, 1, Items.get(Constants.BlockName.Adapter).createItemStack(1), Cable, Constants.BlockName.Adapter) whenCrafting(Constants.BlockName.PowerDistributor).
add()
val Switch = newAchievement("switch").
at(-4, 0).
withParent(Cable).
whenCrafting(Constants.BlockName.Switch).
whenCrafting(Constants.BlockName.AccessPoint).
add()
val Adapter = newAchievement("adapter").
at(-4, 1).
withParent(Cable).
whenCrafting(Constants.BlockName.Adapter).
add()
def init() { def init() {
// Missing @Override causes ambiguity, so cast is required; still a virtual call, // Missing @Override causes ambiguity, so cast is required; still a virtual call,
// so Achievement.registerStat is still the method that's really being called. // so Achievement.registerStat is still the method that's really being called.
All.foreach(_.asInstanceOf[StatBase].registerStat()) All.foreach(_.asInstanceOf[StatBase].registerStat())
AchievementPage.registerAchievementPage(new AchievementPage("OpenComputers", All: _*)) AchievementPage.registerAchievementPage(new AchievementPage(OpenComputers.Name, All: _*))
} }
def onAssemble(stack: ItemStack, player: EntityPlayer): Unit = { def onAssemble(stack: ItemStack, player: EntityPlayer): Unit = {
val descriptor = Items.get(stack) AssemblingMap.get(Items.get(stack)).foreach(player.addStat(_, 1))
if (descriptor == Items.get(Constants.BlockName.Microcontroller)) player.addStat(Microcontroller, 1)
if (descriptor == Items.get(Constants.BlockName.Robot)) player.addStat(Robot, 1)
if (descriptor == Items.get(Constants.ItemName.Drone)) player.addStat(Drone, 1)
if (descriptor == Items.get(Constants.ItemName.Tablet)) player.addStat(Tablet, 1)
} }
def onCraft(stack: ItemStack, player: EntityPlayer): Unit = { def onCraft(stack: ItemStack, player: EntityPlayer): Unit = {
CraftingMap.get(Items.get(stack)).foreach(player.addStat(_, 1)) CraftingMap.get(Items.get(stack)).foreach(player.addStat(_, 1))
CustomCraftingMap.find(entry => ItemStack.areItemStacksEqual(stack, entry._1)).foreach(entry => player.addStat(entry._2, 1))
if (ItemStack.areItemStacksEqual(stack, Items.createOpenOS())) {
player.addStat(OpenOS, 1)
}
} }
}
class Achievement(name: String, description: String, x: Int, y: Int, stack: ItemStack, parent: MCAchievement, requirements: String*) extends MCAchievement(name, description, x, y, stack, parent) { private def newAchievement(name: String) = new AchievementBuilder(name)
Achievement.All += this
for (requirement <- requirements) { private class AchievementBuilder(val name: String) {
val descriptor = Items.get(requirement) var x = 0
if (descriptor != null) { var y = 0
Achievement.CraftingMap += descriptor -> this var stack = stackFromName(name)
var parent: Option[MCAchievement] = None
var crafting = mutable.Set.empty[String]
var customCrafting = mutable.Set.empty[ItemStack]
var assembling = mutable.Set.empty[String]
def at(x: Int, y: Int): AchievementBuilder = {
this.x = x
this.y = y
this
} }
def withIconOf(stack: ItemStack): AchievementBuilder = {
this.stack = Option(stack)
this
}
def withParent(parent: MCAchievement): AchievementBuilder = {
this.parent = Option(parent)
this
}
def whenCrafting(name: String): AchievementBuilder = {
crafting += name
if (stack.isEmpty) stack = stackFromName(name)
this
}
def whenCrafting(stack: ItemStack): AchievementBuilder = {
customCrafting += stack
if (this.stack.isEmpty) this.stack = Option(stack)
this
}
def whenAssembling(name: String): AchievementBuilder = {
assembling += name
if (stack.isEmpty) stack = stackFromName(name)
this
}
def add(): MCAchievement = {
val achievement = new MCAchievement("oc." + name, "oc." + name, x, y, stack.orNull, parent.orNull)
if (parent.isEmpty) {
achievement.asInstanceOf[StatBase].initIndependentStat()
}
for (requirement <- crafting) {
val descriptor = Items.get(requirement)
if (descriptor != null) {
Achievement.CraftingMap += descriptor -> achievement
}
}
for (requirement <- customCrafting) {
if (requirement != null) {
Achievement.CustomCraftingMap += requirement -> achievement
}
}
for (requirement <- assembling) {
val descriptor = Items.get(requirement)
if (descriptor != null) {
Achievement.AssemblingMap += descriptor -> achievement
}
}
Achievement.All += achievement
achievement
}
private def stackFromName(name: String) = Option(Items.get(name)).map(_.createItemStack(1))
} }
} }

View File

@ -257,6 +257,13 @@ object EventHandler {
(month == Calendar.DECEMBER && dayOfMonth == 14) (month == Calendar.DECEMBER && dayOfMonth == 14)
} }
def isItTime = {
val now = Calendar.getInstance()
val month = now.get(Calendar.MONTH)
val dayOfMonth = now.get(Calendar.DAY_OF_MONTH)
month == Calendar.APRIL && dayOfMonth == 1
}
private def recraft(e: ItemCraftedEvent, item: ItemInfo, callback: ItemStack => Option[ItemStack]): Boolean = { private def recraft(e: ItemCraftedEvent, item: ItemInfo, callback: ItemStack => Option[ItemStack]): Boolean = {
if (api.Items.get(e.crafting) == item) { if (api.Items.get(e.crafting) == item) {
for (slot <- 0 until e.craftMatrix.getSizeInventory) { for (slot <- 0 until e.craftMatrix.getSizeInventory) {

View File

@ -2,6 +2,7 @@ package li.cil.oc.common.block
import java.util import java.util
import li.cil.oc.Constants
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api import li.cil.oc.api
import li.cil.oc.client.KeyBindings import li.cil.oc.client.KeyBindings
@ -76,7 +77,7 @@ class Microcontroller(protected implicit val tileTag: ClassTag[tileentity.Microc
} }
true true
} }
else if (api.Items.get(player.getHeldItem) == api.Items.get("eeprom")) { else if (api.Items.get(player.getHeldItem) == api.Items.get(Constants.ItemName.EEPROM)) {
if (!world.isRemote) { if (!world.isRemote) {
world.getTileEntity(pos) match { world.getTileEntity(pos) match {
case mcu: tileentity.Microcontroller => case mcu: tileentity.Microcontroller =>

View File

@ -159,10 +159,7 @@ object Items extends ItemAPI {
get(Constants.ItemName.RAMTier6).createItemStack(1) get(Constants.ItemName.RAMTier6).createItemStack(1)
) )
val stack = get(Constants.ItemName.Drone).createItemStack(1) data.createItemStack()
data.save(stack)
stack
} }
def createConfiguredMicrocontroller() = { def createConfiguredMicrocontroller() = {
@ -182,10 +179,7 @@ object Items extends ItemAPI {
get(Constants.ItemName.RAMTier6).createItemStack(1) get(Constants.ItemName.RAMTier6).createItemStack(1)
) )
val stack = get(Constants.BlockName.Microcontroller).createItemStack(1) data.createItemStack()
data.save(stack)
stack
} }
def createConfiguredRobot() = { def createConfiguredRobot() = {
@ -226,10 +220,7 @@ object Items extends ItemAPI {
get(Constants.BlockName.DiskDrive).createItemStack(1) get(Constants.BlockName.DiskDrive).createItemStack(1)
) )
val stack = get(Constants.BlockName.Robot).createItemStack(1) data.createItemStack()
data.save(stack)
stack
} }
def createConfiguredTablet() = { def createConfiguredTablet() = {

View File

@ -83,10 +83,11 @@ class Delegator extends Item {
override def isBookEnchantable(itemA: ItemStack, itemB: ItemStack): Boolean = false override def isBookEnchantable(itemA: ItemStack, itemB: ItemStack): Boolean = false
override def getRarity(stack: ItemStack) = Delegator.subItem(stack) match { override def getRarity(stack: ItemStack) =
case Some(subItem) => subItem.rarity(stack) Delegator.subItem(stack) match {
case _ => EnumRarity.COMMON case Some(subItem) => subItem.rarity(stack)
} case _ => EnumRarity.COMMON
}
override def getColorFromItemStack(stack: ItemStack, pass: Int) = override def getColorFromItemStack(stack: ItemStack, pass: Int) =
Delegator.subItem(stack) match { Delegator.subItem(stack) match {

View File

@ -1,5 +1,6 @@
package li.cil.oc.common.item package li.cil.oc.common.item
import li.cil.oc.Constants
import li.cil.oc.api import li.cil.oc.api
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
@ -7,8 +8,8 @@ class InkCartridge(val parent: Delegator) extends Delegate {
override def maxStackSize = 1 override def maxStackSize = 1
override def getContainerItem(stack: ItemStack): ItemStack = { override def getContainerItem(stack: ItemStack): ItemStack = {
if (api.Items.get(stack) == api.Items.get("inkCartridge")) if (api.Items.get(stack) == api.Items.get(Constants.ItemName.InkCartridge))
api.Items.get("inkCartridgeEmpty").createItemStack(1) api.Items.get(Constants.ItemName.InkCartridgeEmpty).createItemStack(1)
else else
super.getContainerItem(stack) super.getContainerItem(stack)
} }

View File

@ -30,7 +30,7 @@ class MicrocontrollerData extends ItemData {
// Reserve slot for EEPROM if necessary, avoids having to resize the // Reserve slot for EEPROM if necessary, avoids having to resize the
// components array in the MCU tile entity, which isn't possible currently. // components array in the MCU tile entity, which isn't possible currently.
if (!components.exists(stack => api.Items.get(stack) == api.Items.get("eeprom"))) { if (!components.exists(stack => api.Items.get(stack) == api.Items.get(Constants.ItemName.EEPROM))) {
components :+= null components :+= null
} }
} }

View File

@ -126,9 +126,9 @@ object PrintData {
private val inkPerCartridge = Settings.get.printInkValue private val inkPerCartridge = Settings.get.printInkValue
def materialValue(stack: ItemStack) = { def materialValue(stack: ItemStack) = {
if (api.Items.get(stack) == api.Items.get("chamelium")) if (api.Items.get(stack) == api.Items.get(Constants.ItemName.Chamelium))
materialPerItem materialPerItem
else if (api.Items.get(stack) == api.Items.get("print")) { else if (api.Items.get(stack) == api.Items.get(Constants.BlockName.Print)) {
val data = new PrintData(stack) val data = new PrintData(stack)
computeCosts(data) match { computeCosts(data) match {
case Some((materialRequired, inkRequired)) => (materialRequired * Settings.get.printRecycleRate).toInt case Some((materialRequired, inkRequired)) => (materialRequired * Settings.get.printRecycleRate).toInt
@ -139,7 +139,7 @@ object PrintData {
} }
def inkValue(stack: ItemStack) = { def inkValue(stack: ItemStack) = {
if (api.Items.get(stack) == api.Items.get("inkCartridge")) if (api.Items.get(stack) == api.Items.get(Constants.ItemName.InkCartridge))
inkPerCartridge inkPerCartridge
else if (Color.isDye(stack)) else if (Color.isDye(stack))
inkPerCartridge / 10 inkPerCartridge / 10

View File

@ -1,5 +1,6 @@
package li.cil.oc.common.tileentity package li.cil.oc.common.tileentity
import li.cil.oc.Constants
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api import li.cil.oc.api
import li.cil.oc.api.internal import li.cil.oc.api.internal
@ -235,7 +236,7 @@ class Microcontroller extends traits.PowerAcceptor with traits.Hub with traits.C
// For hotswapping EEPROMs. // For hotswapping EEPROMs.
def changeEEPROM(newEeprom: ItemStack) = { def changeEEPROM(newEeprom: ItemStack) = {
val oldEepromIndex = info.components.indexWhere(api.Items.get(_) == api.Items.get("eeprom")) val oldEepromIndex = info.components.indexWhere(api.Items.get(_) == api.Items.get(Constants.ItemName.EEPROM))
if (oldEepromIndex >= 0) { if (oldEepromIndex >= 0) {
val oldEeprom = info.components(oldEepromIndex) val oldEeprom = info.components(oldEepromIndex)
super.setInventorySlotContents(oldEepromIndex, newEeprom) super.setInventorySlotContents(oldEepromIndex, newEeprom)

View File

@ -4,9 +4,7 @@ import codechicken.lib.data.MCDataInput
import codechicken.lib.data.MCDataOutput import codechicken.lib.data.MCDataOutput
import codechicken.lib.vec.Cuboid6 import codechicken.lib.vec.Cuboid6
import codechicken.lib.vec.Vector3 import codechicken.lib.vec.Vector3
import codechicken.multipart._ import li.cil.oc.Constants
import cpw.mods.fml.relauncher.Side
import cpw.mods.fml.relauncher.SideOnly
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api import li.cil.oc.api
import li.cil.oc.api.Items import li.cil.oc.api.Items
@ -20,7 +18,6 @@ import li.cil.oc.common.block.Cable
import li.cil.oc.common.tileentity import li.cil.oc.common.tileentity
import li.cil.oc.util.Color import li.cil.oc.util.Color
import li.cil.oc.util.ExtendedNBT._ import li.cil.oc.util.ExtendedNBT._
import net.minecraft.client.renderer.RenderBlocks
import net.minecraft.entity.player.EntityPlayer import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraft.nbt.NBTTagCompound import net.minecraft.nbt.NBTTagCompound
@ -55,9 +52,9 @@ class CablePart(val original: Option[tileentity.Cable] = None) extends SimpleBlo
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
override def simpleBlock = Items.get("cable").block().asInstanceOf[Cable] override def simpleBlock = Items.get(Constants.BlockName.Cable).block().asInstanceOf[Cable]
def getType = Settings.namespace + "cable" def getType = Settings.namespace + Constants.BlockName.Cable
override def doesTick = false override def doesTick = false

View File

@ -4,8 +4,7 @@ import codechicken.lib.packet.PacketCustom
import codechicken.lib.raytracer.RayTracer import codechicken.lib.raytracer.RayTracer
import codechicken.lib.vec.BlockCoord import codechicken.lib.vec.BlockCoord
import codechicken.lib.vec.Vector3 import codechicken.lib.vec.Vector3
import codechicken.multipart.TileMultipart import li.cil.oc.Constants
import cpw.mods.fml.common.eventhandler.SubscribeEvent
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api.Items import li.cil.oc.api.Items
import li.cil.oc.client.PacketSender import li.cil.oc.client.PacketSender
@ -51,10 +50,10 @@ object EventHandler {
case itemBlock: ItemBlock => case itemBlock: ItemBlock =>
itemBlock.field_150939_a match { itemBlock.field_150939_a match {
case simpleBlock: SimpleBlock => case simpleBlock: SimpleBlock =>
if (simpleBlock == Items.get("cable").block()) { if (simpleBlock == Items.get(Constants.BlockName.Cable).block()) {
placeDelegatePart(player, hit, new CablePart()) placeDelegatePart(player, hit, new CablePart())
} }
else if (simpleBlock == Items.get("print").block()) { else if (simpleBlock == Items.get(Constants.BlockName.Print).block()) {
val part = new PrintPart() val part = new PrintPart()
part.data.load(player.getHeldItem) part.data.load(player.getHeldItem)
part.facing = yaw2Direction((player.rotationYaw / 360 * 4).round & 3).getOpposite part.facing = yaw2Direction((player.rotationYaw / 360 * 4).round & 3).getOpposite

View File

@ -3,8 +3,7 @@ package li.cil.oc.integration.fmp
import java.util import java.util
import codechicken.lib.vec.BlockCoord import codechicken.lib.vec.BlockCoord
import codechicken.multipart.MultiPartRegistry import li.cil.oc.Constants
import codechicken.multipart.MultiPartRegistry.IPartConverter
import li.cil.oc.api.Items import li.cil.oc.api.Items
import li.cil.oc.common.tileentity.Cable import li.cil.oc.common.tileentity.Cable
import li.cil.oc.common.tileentity.Print import li.cil.oc.common.tileentity.Print
@ -16,8 +15,8 @@ object MultipartConverter extends IPartConverter {
} }
override def blockTypes = util.Arrays.asList( override def blockTypes = util.Arrays.asList(
Items.get("cable").block, Items.get(Constants.BlockName.Cable).block,
Items.get("print").block Items.get(Constants.BlockName.Print).block
) )
override def convert(world: World, pos: BlockCoord) = { override def convert(world: World, pos: BlockCoord) = {

View File

@ -7,6 +7,7 @@ import codechicken.lib.data.MCDataOutput
import codechicken.lib.raytracer.ExtendedMOP import codechicken.lib.raytracer.ExtendedMOP
import codechicken.lib.vec.Cuboid6 import codechicken.lib.vec.Cuboid6
import codechicken.lib.vec.Vector3 import codechicken.lib.vec.Vector3
import li.cil.oc.Constants
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api.Items import li.cil.oc.api.Items
import li.cil.oc.common.block.Print import li.cil.oc.common.block.Print
@ -88,9 +89,9 @@ class PrintPart(val original: Option[tileentity.Print] = None) extends SimpleBlo
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
override def simpleBlock = Items.get("print").block().asInstanceOf[Print] override def simpleBlock = Items.get(Constants.BlockName.Print).block().asInstanceOf[Print]
def getType = Settings.namespace + "print" def getType = Settings.namespace + Constants.BlockName.Print
override def doesTick = false override def doesTick = false

View File

@ -1,5 +1,6 @@
package li.cil.oc.integration.gc package li.cil.oc.integration.gc
import li.cil.oc.Constants
import li.cil.oc.api import li.cil.oc.api
import li.cil.oc.api.driver.EnvironmentAware import li.cil.oc.api.driver.EnvironmentAware
import li.cil.oc.api.driver.EnvironmentHost import li.cil.oc.api.driver.EnvironmentHost
@ -11,7 +12,7 @@ import net.minecraft.item.ItemStack
object DriverWorldSensorCard extends Item with HostAware with EnvironmentAware { object DriverWorldSensorCard extends Item with HostAware with EnvironmentAware {
override def worksWith(stack: ItemStack) = override def worksWith(stack: ItemStack) =
isOneOf(stack, api.Items.get("worldSensorCard")) isOneOf(stack, api.Items.get(Constants.ItemName.WorldSensorCard))
override def createEnvironment(stack: ItemStack, host: EnvironmentHost) = override def createEnvironment(stack: ItemStack, host: EnvironmentHost) =
if (Mods.Galacticraft.isAvailable) new WorldSensorCard(host) if (Mods.Galacticraft.isAvailable) new WorldSensorCard(host)

View File

@ -30,10 +30,11 @@ object DriverCPU extends Item with Processor {
case _ => Tier.One case _ => Tier.One
} }
override def supportedComponents(stack: ItemStack) = Delegator.subItem(stack) match { override def supportedComponents(stack: ItemStack) =
case Some(cpu: item.CPU) => Settings.get.cpuComponentSupport(cpu.tier) Delegator.subItem(stack) match {
case _ => Tier.One case Some(cpu: item.CPU) => Settings.get.cpuComponentSupport(cpu.tier)
} case _ => Tier.One
}
override def architecture(stack: ItemStack): Class[_ <: Architecture] = { override def architecture(stack: ItemStack): Class[_ <: Architecture] = {
if (stack.hasTagCompound) { if (stack.hasTagCompound) {

View File

@ -21,15 +21,17 @@ object DriverComponentBus extends Item with Processor {
override def slot(stack: ItemStack) = Slot.ComponentBus override def slot(stack: ItemStack) = Slot.ComponentBus
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(bus: item.ComponentBus) => bus.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(bus: item.ComponentBus) => bus.tier
} case _ => Tier.One
}
override def supportedComponents(stack: ItemStack) = Delegator.subItem(stack) match { override def supportedComponents(stack: ItemStack) =
case Some(bus: item.ComponentBus) => Settings.get.cpuComponentSupport(bus.tier) Delegator.subItem(stack) match {
case _ => Tier.One case Some(bus: item.ComponentBus) => Settings.get.cpuComponentSupport(bus.tier)
} case _ => Tier.One
}
override def architecture(stack: ItemStack) = null override def architecture(stack: ItemStack) = null
} }

View File

@ -24,8 +24,9 @@ object DriverContainerCard extends Item with Container {
override def providedTier(stack: ItemStack) = tier(stack) override def providedTier(stack: ItemStack) = tier(stack)
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(container: item.UpgradeContainerCard) => container.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(container: item.UpgradeContainerCard) => container.tier
} case _ => Tier.One
}
} }

View File

@ -24,8 +24,9 @@ object DriverContainerUpgrade extends Item with Container {
override def providedTier(stack: ItemStack) = tier(stack) override def providedTier(stack: ItemStack) = tier(stack)
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(container: item.UpgradeContainerUpgrade) => container.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(container: item.UpgradeContainerUpgrade) => container.tier
} case _ => Tier.One
}
} }

View File

@ -22,22 +22,25 @@ object DriverFileSystem extends Item {
api.Items.get(Constants.ItemName.Floppy)) && api.Items.get(Constants.ItemName.Floppy)) &&
(!stack.hasTagCompound || !stack.getTagCompound.hasKey(Settings.namespace + "lootPath")) (!stack.hasTagCompound || !stack.getTagCompound.hasKey(Settings.namespace + "lootPath"))
override def createEnvironment(stack: ItemStack, host: EnvironmentHost) = Delegator.subItem(stack) match { override def createEnvironment(stack: ItemStack, host: EnvironmentHost) =
case Some(hdd: HardDiskDrive) => createEnvironment(stack, hdd.kiloBytes * 1024, host) Delegator.subItem(stack) match {
case Some(disk: FloppyDisk) => createEnvironment(stack, Settings.get.floppySize * 1024, host) case Some(hdd: HardDiskDrive) => createEnvironment(stack, hdd.kiloBytes * 1024, host)
case _ => null case Some(disk: FloppyDisk) => createEnvironment(stack, Settings.get.floppySize * 1024, host)
} case _ => null
}
override def slot(stack: ItemStack) = Delegator.subItem(stack) match { override def slot(stack: ItemStack) =
case Some(hdd: HardDiskDrive) => Slot.HDD Delegator.subItem(stack) match {
case Some(disk: FloppyDisk) => Slot.Floppy case Some(hdd: HardDiskDrive) => Slot.HDD
case _ => throw new IllegalArgumentException() case Some(disk: FloppyDisk) => Slot.Floppy
} case _ => throw new IllegalArgumentException()
}
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(hdd: HardDiskDrive) => hdd.tier Delegator.subItem(stack) match {
case _ => 0 case Some(hdd: HardDiskDrive) => hdd.tier
} case _ => 0
}
private def createEnvironment(stack: ItemStack, capacity: Int, host: EnvironmentHost) = if (DimensionManager.getWorld(0) != null) { private def createEnvironment(stack: ItemStack, capacity: Int, host: EnvironmentHost) = if (DimensionManager.getWorld(0) != null) {
// We have a bit of a chicken-egg problem here, because we want to use the // We have a bit of a chicken-egg problem here, because we want to use the

View File

@ -28,10 +28,11 @@ object DriverGraphicsCard extends Item with HostAware with EnvironmentAware {
override def slot(stack: ItemStack) = Slot.Card override def slot(stack: ItemStack) = Slot.Card
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(gpu: common.item.GraphicsCard) => gpu.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(gpu: common.item.GraphicsCard) => gpu.tier
} case _ => Tier.One
}
override def providedEnvironment(stack: ItemStack) = classOf[component.GraphicsCard] override def providedEnvironment(stack: ItemStack) = classOf[component.GraphicsCard]
} }

View File

@ -27,8 +27,9 @@ object DriverMemory extends Item with driver.item.Memory {
override def slot(stack: ItemStack) = Slot.Memory override def slot(stack: ItemStack) = Slot.Memory
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(memory: item.Memory) => memory.tier / 2 Delegator.subItem(stack) match {
case _ => Tier.One case Some(memory: item.Memory) => memory.tier / 2
} case _ => Tier.One
}
} }

View File

@ -41,10 +41,11 @@ object DriverRedstoneCard extends Item with HostAware with EnvironmentAware {
override def slot(stack: ItemStack) = Slot.Card override def slot(stack: ItemStack) = Slot.Card
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(card: item.RedstoneCard) => card.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(card: item.RedstoneCard) => card.tier
} case _ => Tier.One
}
override def providedEnvironment(stack: ItemStack): Class[_ <: Environment] = { override def providedEnvironment(stack: ItemStack): Class[_ <: Environment] = {
val isAdvanced = tier(stack) == Tier.Two val isAdvanced = tier(stack) == Tier.Two

View File

@ -21,8 +21,9 @@ object DriverUpgradeBattery extends Item with HostAware {
override def slot(stack: ItemStack) = Slot.Upgrade override def slot(stack: ItemStack) = Slot.Upgrade
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(battery: item.UpgradeBattery) => battery.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(battery: item.UpgradeBattery) => battery.tier
} case _ => Tier.One
}
} }

View File

@ -31,10 +31,11 @@ object DriverUpgradeDatabase extends Item with HostAware with EnvironmentAware {
override def slot(stack: ItemStack) = Slot.Upgrade override def slot(stack: ItemStack) = Slot.Upgrade
override def tier(stack: ItemStack) = Delegator.subItem(stack) match { override def tier(stack: ItemStack) =
case Some(database: item.UpgradeDatabase) => database.tier Delegator.subItem(stack) match {
case _ => Tier.One case Some(database: item.UpgradeDatabase) => database.tier
} case _ => Tier.One
}
override def providedEnvironment(stack: ItemStack) = classOf[component.UpgradeDatabase] override def providedEnvironment(stack: ItemStack) = classOf[component.UpgradeDatabase]
} }

View File

@ -1,5 +1,6 @@
package li.cil.oc.integration.stargatetech2 package li.cil.oc.integration.stargatetech2
import li.cil.oc.Constants
import li.cil.oc.api import li.cil.oc.api
import li.cil.oc.api.driver.EnvironmentAware import li.cil.oc.api.driver.EnvironmentAware
import li.cil.oc.api.driver.EnvironmentHost import li.cil.oc.api.driver.EnvironmentHost
@ -11,7 +12,7 @@ import net.minecraft.item.ItemStack
object DriverAbstractBusCard extends Item with HostAware with EnvironmentAware { object DriverAbstractBusCard extends Item with HostAware with EnvironmentAware {
override def worksWith(stack: ItemStack) = override def worksWith(stack: ItemStack) =
isOneOf(stack, api.Items.get("abstractBusCard")) isOneOf(stack, api.Items.get(Constants.ItemName.AbstractBusCard))
override def worksWith(stack: ItemStack, host: Class[_ <: EnvironmentHost]) = override def worksWith(stack: ItemStack, host: Class[_ <: EnvironmentHost]) =
worksWith(stack) && (isComputer(host) || isRobot(host) || isServer(host) || isMicrocontroller(host)) worksWith(stack) && (isComputer(host) || isRobot(host) || isServer(host) || isMicrocontroller(host))