mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 12:17:17 -04:00
Some more refactoring.
This commit is contained in:
parent
4f804c39d4
commit
e0f53562de
@ -15,13 +15,14 @@ import li.cil.oc.common.Tier
|
||||
import li.cil.oc.common.block.SimpleBlock
|
||||
import li.cil.oc.common.item
|
||||
import li.cil.oc.common.item.Delegator
|
||||
import li.cil.oc.common.item.SimpleItem
|
||||
import li.cil.oc.common.item.UpgradeLeash
|
||||
import li.cil.oc.common.item.data.DroneData
|
||||
import li.cil.oc.common.item.data.HoverBootsData
|
||||
import li.cil.oc.common.item.data.MicrocontrollerData
|
||||
import li.cil.oc.common.item.data.RobotData
|
||||
import li.cil.oc.common.item.data.TabletData
|
||||
import li.cil.oc.common.item.traits.Delegate
|
||||
import li.cil.oc.common.item.traits.SimpleItem
|
||||
import li.cil.oc.common.recipe.Recipes
|
||||
import li.cil.oc.integration.Mods
|
||||
import net.minecraft.block.Block
|
||||
@ -70,7 +71,7 @@ object Items extends ItemAPI {
|
||||
instance
|
||||
}
|
||||
|
||||
def registerItem[T <: common.item.Delegate](delegate: T, id: String) = {
|
||||
def registerItem[T <: Delegate](delegate: T, id: String) = {
|
||||
descriptors += id -> new ItemInfo {
|
||||
override def name = id
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class ALU(val parent: Delegator) extends Delegate
|
||||
class ALU(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import scala.language.existentials
|
||||
|
||||
class APU(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier with traits.CPULike with traits.GPULike {
|
||||
class APU(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier with traits.CPULike with traits.GPULike {
|
||||
override val unlocalizedName = super[Delegate].unlocalizedName + tier
|
||||
|
||||
override def cpuTier = tier + 1
|
||||
|
@ -2,6 +2,6 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.integration.Mods
|
||||
|
||||
class AbstractBusCard(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class AbstractBusCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
showInItemList = Mods.StargateTech2.isAvailable
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class Acid(val parent: Delegator) extends Delegate
|
||||
class Acid(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -68,7 +68,7 @@ object Analyzer {
|
||||
}
|
||||
playerMP.addChatMessage(Localization.Analyzer.Components(machine.componentCount, machine.maxComponents))
|
||||
val list = machine.users
|
||||
if (list.length > 0) {
|
||||
if (list.nonEmpty) {
|
||||
playerMP.addChatMessage(Localization.Analyzer.Users(list))
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ object Analyzer {
|
||||
}
|
||||
}
|
||||
|
||||
class Analyzer(val parent: Delegator) extends Delegate {
|
||||
class Analyzer(val parent: Delegator) extends traits.Delegate {
|
||||
override def onItemRightClick(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = {
|
||||
if (player.isSneaking && stack.hasTagCompound) {
|
||||
stack.getTagCompound.removeTag(Settings.namespace + "clipboard")
|
||||
|
@ -1,5 +1,5 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class ArrowKeys(val parent: Delegator) extends Delegate {
|
||||
class ArrowKeys(val parent: Delegator) extends traits.Delegate {
|
||||
override protected def tooltipName = None
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class ButtonGroup(val parent: Delegator) extends Delegate {
|
||||
class ButtonGroup(val parent: Delegator) extends traits.Delegate {
|
||||
override protected def tooltipName = None
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import scala.language.existentials
|
||||
|
||||
class CPU(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier with traits.CPULike {
|
||||
class CPU(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier with traits.CPULike {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override def cpuTier = tier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class CardBase(val parent: Delegator) extends Delegate
|
||||
class CardBase(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -8,7 +8,7 @@ import net.minecraft.potion.Potion
|
||||
import net.minecraft.potion.PotionEffect
|
||||
import net.minecraft.world.World
|
||||
|
||||
class Chamelium(val parent: Delegator) extends Delegate {
|
||||
class Chamelium(val parent: Delegator) extends traits.Delegate {
|
||||
override def onItemRightClick(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = {
|
||||
if (Settings.get.chameliumEdible) {
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack))
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class CircuitBoard(val parent: Delegator) extends Delegate
|
||||
class CircuitBoard(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.Settings
|
||||
|
||||
class ComponentBus(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class ComponentBus(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class ControlUnit(val parent: Delegator) extends Delegate
|
||||
class ControlUnit(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class CuttingWire(val parent: Delegator) extends Delegate
|
||||
class CuttingWire(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -7,7 +7,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.world.World
|
||||
|
||||
class DebugCard(val parent: Delegator) extends Delegate {
|
||||
class DebugCard(val parent: Delegator) extends traits.Delegate {
|
||||
override protected def tooltipExtended(stack: ItemStack, tooltip: util.List[String]): Unit = {
|
||||
super.tooltipExtended(stack, tooltip)
|
||||
val data = new DebugCardData(stack)
|
||||
|
@ -10,7 +10,7 @@ import net.minecraft.entity.player.EntityPlayerMP
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraftforge.common.util.ForgeDirection
|
||||
|
||||
class Debugger(val parent: Delegator) extends Delegate {
|
||||
class Debugger(val parent: Delegator) extends traits.Delegate {
|
||||
override def onItemUse(stack: ItemStack, player: EntityPlayer, position: BlockPosition, side: Int, hitX: Float, hitY: Float, hitZ: Float) = {
|
||||
val world = position.world.get
|
||||
player match {
|
||||
|
@ -55,15 +55,15 @@ class Delegator extends Item with driver.item.UpgradeRenderer with Chargeable {
|
||||
case _ => maxStackSize
|
||||
}
|
||||
|
||||
val subItems = mutable.ArrayBuffer.empty[Delegate]
|
||||
val subItems = mutable.ArrayBuffer.empty[traits.Delegate]
|
||||
|
||||
def add(subItem: Delegate) = {
|
||||
def add(subItem: traits.Delegate) = {
|
||||
val itemId = subItems.length
|
||||
subItems += subItem
|
||||
itemId
|
||||
}
|
||||
|
||||
def subItem(stack: ItemStack): Option[Delegate] =
|
||||
def subItem(stack: ItemStack): Option[traits.Delegate] =
|
||||
if (stack != null) subItem(stack.getItemDamage) match {
|
||||
case Some(subItem) if stack.getItem == this => Some(subItem)
|
||||
case _ => None
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class Disk(val parent: Delegator) extends Delegate
|
||||
class Disk(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -6,22 +6,22 @@ import cpw.mods.fml.relauncher.Side
|
||||
import cpw.mods.fml.relauncher.SideOnly
|
||||
import li.cil.oc.client.KeyBindings
|
||||
import li.cil.oc.common.entity
|
||||
import li.cil.oc.common.item.data.MicrocontrollerData
|
||||
import li.cil.oc.server.agent
|
||||
import li.cil.oc.common.item.data.DroneData
|
||||
import li.cil.oc.integration.util.NEI
|
||||
import li.cil.oc.server.agent
|
||||
import li.cil.oc.util.BlockPosition
|
||||
import li.cil.oc.util.Rarity
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class Drone(val parent: Delegator) extends Delegate {
|
||||
class Drone(val parent: Delegator) extends traits.Delegate {
|
||||
NEI.hide(this)
|
||||
|
||||
showInItemList = false
|
||||
|
||||
override protected def tooltipExtended(stack: ItemStack, tooltip: util.List[String]): Unit = {
|
||||
if (KeyBindings.showExtendedTooltips) {
|
||||
val info = new MicrocontrollerData(stack)
|
||||
val info = new DroneData(stack)
|
||||
for (component <- info.components if component != null) {
|
||||
tooltip.add("- " + component.getDisplayName)
|
||||
}
|
||||
@ -29,7 +29,7 @@ class Drone(val parent: Delegator) extends Delegate {
|
||||
}
|
||||
|
||||
override def rarity(stack: ItemStack) = {
|
||||
val data = new MicrocontrollerData(stack)
|
||||
val data = new DroneData(stack)
|
||||
Rarity.byTier(data.tier)
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class DroneCase(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class DroneCase(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tierFromDriver(stack: ItemStack) = tier
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.world.World
|
||||
|
||||
class EEPROM extends SimpleItem {
|
||||
class EEPROM extends traits.SimpleItem {
|
||||
override def doesSneakBypassUse(world: World, x: Int, y: Int, z: Int, player: EntityPlayer): Boolean = true
|
||||
|
||||
override def getItemStackDisplayName(stack: ItemStack): String = {
|
||||
|
@ -9,7 +9,7 @@ import li.cil.oc.util.Color
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class FloppyDisk(val parent: Delegator) extends Delegate {
|
||||
class FloppyDisk(val parent: Delegator) extends traits.Delegate {
|
||||
// Necessary for anonymous subclasses used for loot disks.
|
||||
override def unlocalizedName = "FloppyDisk"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class GraphicsCard(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier with traits.GPULike {
|
||||
class GraphicsCard(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier with traits.GPULike {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override def gpuTier = tier
|
||||
|
@ -6,7 +6,7 @@ import li.cil.oc.Settings
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class HardDiskDrive(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class HardDiskDrive(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
val kiloBytes = Settings.get.hddSizes(tier)
|
||||
|
||||
|
@ -10,7 +10,7 @@ import net.minecraft.item.EnumRarity
|
||||
import net.minecraft.item.ItemArmor
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class HoverBoots extends ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 0, 3) with SimpleItem with traits.Chargeable {
|
||||
class HoverBoots extends ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 0, 3) with traits.SimpleItem with traits.Chargeable {
|
||||
setNoRepair()
|
||||
|
||||
override def getRarity(stack: ItemStack): EnumRarity = EnumRarity.uncommon
|
||||
|
@ -4,7 +4,7 @@ import li.cil.oc.Constants
|
||||
import li.cil.oc.api
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class InkCartridge(val parent: Delegator) extends Delegate {
|
||||
class InkCartridge(val parent: Delegator) extends traits.Delegate {
|
||||
override def maxStackSize = 1
|
||||
|
||||
override def getContainerItem(stack: ItemStack): ItemStack = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class InkCartridgeEmpty(val parent: Delegator) extends Delegate {
|
||||
class InkCartridgeEmpty(val parent: Delegator) extends traits.Delegate {
|
||||
override def maxStackSize = 1
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class InternetCard(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class InternetCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class Interweb(val parent: Delegator) extends Delegate
|
||||
class Interweb(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -2,6 +2,6 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.integration.Mods
|
||||
|
||||
class IronNugget(val parent: Delegator) extends Delegate {
|
||||
class IronNugget(val parent: Delegator) extends traits.Delegate {
|
||||
showInItemList = !Mods.GregTech.isAvailable
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import li.cil.oc.util.Tooltip
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class LinkedCard(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class LinkedCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
override def tooltipLines(stack: ItemStack, player: EntityPlayer, tooltip: util.List[String], advanced: Boolean) {
|
||||
if (stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "data")) {
|
||||
val data = stack.getTagCompound.getCompoundTag(Settings.namespace + "data")
|
||||
|
@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.Side
|
||||
import cpw.mods.fml.relauncher.SideOnly
|
||||
import li.cil.oc.OpenComputers
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.common.item.traits.Delegate
|
||||
import li.cil.oc.util.BlockPosition
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
@ -1,6 +1,6 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class Memory(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class Memory(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -3,7 +3,7 @@ package li.cil.oc.common.item
|
||||
import li.cil.oc.util.Rarity
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class Microchip(val parent: Delegator, val tier: Int) extends Delegate {
|
||||
class Microchip(val parent: Delegator, val tier: Int) extends traits.Delegate {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class MicrocontrollerCase(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class MicrocontrollerCase(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tierFromDriver(stack: ItemStack) = tier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class NetworkCard(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class NetworkCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class NumPad(val parent: Delegator) extends Delegate
|
||||
class NumPad(val parent: Delegator) extends traits.Delegate
|
@ -13,7 +13,7 @@ import net.minecraft.world.World
|
||||
|
||||
import scala.collection.mutable
|
||||
|
||||
class Present(val parent: Delegator) extends Delegate {
|
||||
class Present(val parent: Delegator) extends traits.Delegate {
|
||||
showInItemList = false
|
||||
|
||||
override def onItemRightClick(stack: ItemStack, world: World, player: EntityPlayer) = {
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class PrintedCircuitBoard(val parent: Delegator) extends Delegate
|
||||
class PrintedCircuitBoard(val parent: Delegator) extends traits.Delegate
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class RawCircuitBoard(val parent: Delegator) extends Delegate
|
||||
class RawCircuitBoard(val parent: Delegator) extends traits.Delegate
|
@ -7,7 +7,7 @@ import li.cil.oc.integration.Mods
|
||||
import li.cil.oc.util.Tooltip
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class RedstoneCard(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class RedstoneCard(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -4,7 +4,7 @@ import li.cil.oc.util.BlockPosition
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class RemoteControl(val parent: Delegator) extends Delegate {
|
||||
class RemoteControl(val parent: Delegator) extends traits.Delegate {
|
||||
override def onItemUse(stack: ItemStack, player: EntityPlayer, position: BlockPosition, side: Int, hitX: Float, hitY: Float, hitZ: Float): Boolean = {
|
||||
super.onItemUse(stack, player, position, side, hitX, hitY, hitZ)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import net.minecraft.world.World
|
||||
|
||||
import scala.collection.mutable
|
||||
|
||||
class Server(val parent: Delegator, val tier: Int) extends Delegate {
|
||||
class Server(val parent: Delegator, val tier: Int) extends traits.Delegate {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -52,7 +52,7 @@ import net.minecraftforge.event.world.WorldEvent
|
||||
import scala.collection.convert.WrapAsJava._
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
|
||||
class Tablet(val parent: Delegator) extends Delegate with Chargeable {
|
||||
class Tablet(val parent: Delegator) extends traits.Delegate with Chargeable {
|
||||
final val TimeToAnalyze = 10
|
||||
|
||||
// Must be assembled to be usable so we hide it in the item list.
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class TabletCase(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class TabletCase(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tierFromDriver(stack: ItemStack) = tier
|
||||
|
@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.world.World
|
||||
|
||||
class Terminal(val parent: Delegator) extends Delegate {
|
||||
class Terminal(val parent: Delegator) extends traits.Delegate {
|
||||
override def maxStackSize = 1
|
||||
|
||||
private var iconOn: Option[Icon] = None
|
||||
|
@ -7,7 +7,7 @@ import net.minecraft.block.Block
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class TexturePicker(val parent: Delegator) extends Delegate {
|
||||
class TexturePicker(val parent: Delegator) extends traits.Delegate {
|
||||
override def onItemUse(stack: ItemStack, player: EntityPlayer, position: BlockPosition, side: Int, hitX: Float, hitY: Float, hitZ: Float): Boolean = {
|
||||
player.getEntityWorld.getBlock(position) match {
|
||||
case block: Block =>
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class Transistor(val parent: Delegator) extends Delegate
|
||||
class Transistor(val parent: Delegator) extends traits.Delegate
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeAngel(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeAngel(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -5,7 +5,7 @@ import li.cil.oc.api.driver.item.Chargeable
|
||||
import li.cil.oc.common.item.data.NodeData
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
class UpgradeBattery(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier with Chargeable {
|
||||
class UpgradeBattery(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier with Chargeable {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeChunkloader(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeChunkloader(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -1,6 +1,6 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeContainerCard(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class UpgradeContainerCard(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,6 +1,6 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeContainerUpgrade(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class UpgradeContainerUpgrade(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeCrafting(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeCrafting(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -8,7 +8,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.world.World
|
||||
|
||||
class UpgradeDatabase(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class UpgradeDatabase(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeExperience(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeExperience(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -2,6 +2,6 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.Settings
|
||||
|
||||
class UpgradeGenerator(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class UpgradeGenerator(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
override protected def tooltipData = Seq((Settings.get.generatorEfficiency * 100).toInt)
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.Settings
|
||||
|
||||
class UpgradeHover(val parent: Delegator, val tier: Int) extends Delegate with traits.ItemTier {
|
||||
class UpgradeHover(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier {
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeInventory(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeInventory(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeInventoryController(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeInventoryController(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeLeash(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeLeash(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeNavigation(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeNavigation(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradePiston(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradePiston(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeSign(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeSign(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
||||
|
@ -2,6 +2,6 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.Settings
|
||||
|
||||
class UpgradeSolarGenerator(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class UpgradeSolarGenerator(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
override protected def tooltipData = Seq((Settings.get.solarGeneratorEfficiency * 100).toInt)
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraftforge.fluids.FluidStack
|
||||
|
||||
class UpgradeTank(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class UpgradeTank(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
@SideOnly(Side.CLIENT) override
|
||||
def tooltipLines(stack: ItemStack, player: EntityPlayer, tooltip: util.List[String], advanced: Boolean) = {
|
||||
if (stack.hasTagCompound) {
|
||||
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeTankController(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeTankController(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class UpgradeTractorBeam(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class UpgradeTractorBeam(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -1,3 +1,3 @@
|
||||
package li.cil.oc.common.item
|
||||
|
||||
class WirelessNetworkCard(val parent: Delegator) extends Delegate with traits.ItemTier
|
||||
class WirelessNetworkCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier
|
@ -2,6 +2,6 @@ package li.cil.oc.common.item
|
||||
|
||||
import li.cil.oc.integration.Mods
|
||||
|
||||
class WorldSensorCard(val parent: Delegator) extends Delegate with traits.ItemTier {
|
||||
class WorldSensorCard(val parent: Delegator) extends traits.Delegate with traits.ItemTier {
|
||||
showInItemList = Mods.Galacticraft.isAvailable
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import net.minecraftforge.common.util.ForgeDirection
|
||||
new Injectable.Interface(value = "mods.railcraft.api.core.items.IToolCrowbar", modid = Mods.IDs.Railcraft),
|
||||
new Injectable.Interface(value = "ic2.api.item.IBoxable", modid = Mods.IDs.IndustrialCraft2)
|
||||
))
|
||||
class Wrench extends SimpleItem with api.internal.Wrench {
|
||||
class Wrench extends traits.SimpleItem with api.internal.Wrench {
|
||||
setHarvestLevel("wrench", 1)
|
||||
|
||||
override def doesSneakBypassUse(world: World, x: Int, y: Int, z: Int, player: EntityPlayer): Boolean = true
|
||||
|
@ -5,7 +5,6 @@ import java.util
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.api.machine.Architecture
|
||||
import li.cil.oc.common.item.Delegate
|
||||
import li.cil.oc.util.Tooltip
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
@ -1,4 +1,4 @@
|
||||
package li.cil.oc.common.item
|
||||
package li.cil.oc.common.item.traits
|
||||
|
||||
import java.util
|
||||
|
||||
@ -8,6 +8,7 @@ import li.cil.oc.Localization
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.client.KeyBindings
|
||||
import li.cil.oc.common.item.Delegator
|
||||
import li.cil.oc.util.BlockPosition
|
||||
import li.cil.oc.util.ItemCosts
|
||||
import li.cil.oc.util.Rarity
|
@ -1,7 +1,6 @@
|
||||
package li.cil.oc.common.item.traits
|
||||
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.common.item.Delegate
|
||||
import li.cil.oc.util.PackedColor
|
||||
|
||||
trait GPULike extends Delegate {
|
||||
|
@ -5,7 +5,6 @@ import java.util
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import cpw.mods.fml.relauncher.SideOnly
|
||||
import li.cil.oc.Localization
|
||||
import li.cil.oc.common.item.Delegate
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package li.cil.oc.common.item
|
||||
package li.cil.oc.common.item.traits
|
||||
|
||||
import java.util
|
||||
import java.util.Random
|
@ -11,8 +11,9 @@ import li.cil.oc.common.Loot
|
||||
import li.cil.oc.common.block.SimpleBlock
|
||||
import li.cil.oc.common.init.Items
|
||||
import li.cil.oc.common.item.Delegator
|
||||
import li.cil.oc.common.item.SimpleItem
|
||||
import li.cil.oc.common.item.data.PrintData
|
||||
import li.cil.oc.common.item.traits.Delegate
|
||||
import li.cil.oc.common.item.traits.SimpleItem
|
||||
import li.cil.oc.integration.util.NEI
|
||||
import li.cil.oc.util.Color
|
||||
import net.minecraft.block.Block
|
||||
@ -51,7 +52,7 @@ object Recipes {
|
||||
instance
|
||||
}
|
||||
|
||||
def addSubItem[T <: common.item.Delegate](delegate: T, name: String, oreDict: String*) = {
|
||||
def addSubItem[T <: Delegate](delegate: T, name: String, oreDict: String*) = {
|
||||
Items.registerItem(delegate, name)
|
||||
addRecipe(delegate.createItemStack(), name)
|
||||
register(delegate.createItemStack(), oreDict: _*)
|
||||
|
@ -1,7 +1,7 @@
|
||||
package li.cil.oc.integration.util
|
||||
|
||||
import codechicken.nei.LayoutManager
|
||||
import li.cil.oc.common.item.Delegate
|
||||
import li.cil.oc.common.item.traits.Delegate
|
||||
import li.cil.oc.integration.Mods
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.client.gui.inventory.GuiContainer
|
||||
|
Loading…
x
Reference in New Issue
Block a user