diff --git a/assets/items.psd b/assets/items.psd index 75f167bfa..1c48a1307 100644 Binary files a/assets/items.psd and b/assets/items.psd differ diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 9c834010e..faeec0252 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -145,11 +145,12 @@ opencomputers { eepromDataSize: 256 # The number of components the different CPU tiers support. This list - # must contain exactly three entries, or it will be ignored. + # must contain exactly four entries, or it will be ignored. cpuComponentCount: [ 8 12 16 + 1024 ] # The provided call budgets by the three tiers of CPU and memory. Higher diff --git a/src/main/resources/assets/opencomputers/doc/de_DE/item/componentBusCreative.md b/src/main/resources/assets/opencomputers/doc/de_DE/item/componentBusCreative.md new file mode 100644 index 000000000..a49cd378a --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/de_DE/item/componentBusCreative.md @@ -0,0 +1 @@ +#REDIRECT componentBus1.md \ No newline at end of file diff --git a/src/main/resources/assets/opencomputers/doc/en_us/item/componentBusCreative.md b/src/main/resources/assets/opencomputers/doc/en_us/item/componentBusCreative.md new file mode 100644 index 000000000..a49cd378a --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/en_us/item/componentBusCreative.md @@ -0,0 +1 @@ +#REDIRECT componentBus1.md \ No newline at end of file diff --git a/src/main/resources/assets/opencomputers/doc/fr_FR/item/componentBusCreative.md b/src/main/resources/assets/opencomputers/doc/fr_FR/item/componentBusCreative.md new file mode 100644 index 000000000..a49cd378a --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/fr_FR/item/componentBusCreative.md @@ -0,0 +1 @@ +#REDIRECT componentBus1.md \ No newline at end of file diff --git a/src/main/resources/assets/opencomputers/doc/ru_RU/item/componentBusCreative.md b/src/main/resources/assets/opencomputers/doc/ru_RU/item/componentBusCreative.md new file mode 100644 index 000000000..a49cd378a --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/ru_RU/item/componentBusCreative.md @@ -0,0 +1 @@ +#REDIRECT componentBus1.md \ No newline at end of file diff --git a/src/main/resources/assets/opencomputers/doc/zh_CN/item/componentBusCreative.md b/src/main/resources/assets/opencomputers/doc/zh_CN/item/componentBusCreative.md new file mode 100644 index 000000000..a49cd378a --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/zh_CN/item/componentBusCreative.md @@ -0,0 +1 @@ +#REDIRECT componentBus1.md \ No newline at end of file diff --git a/src/main/resources/assets/opencomputers/lang/en_US.lang b/src/main/resources/assets/opencomputers/lang/en_US.lang index e938d2ce9..79d7002d6 100644 --- a/src/main/resources/assets/opencomputers/lang/en_US.lang +++ b/src/main/resources/assets/opencomputers/lang/en_US.lang @@ -57,6 +57,7 @@ item.oc.CircuitBoard.name=Circuit Board item.oc.ComponentBus0.name=Component Bus (Tier 1) item.oc.ComponentBus1.name=Component Bus (Tier 2) item.oc.ComponentBus2.name=Component Bus (Tier 3) +item.oc.ComponentBus3.name=Component Bus (Creative) item.oc.ControlUnit.name=Control Unit (CU) item.oc.CPU0.name=Central Processing Unit (CPU) (Tier 1) item.oc.CPU1.name=Central Processing Unit (CPU) (Tier 2) diff --git a/src/main/resources/assets/opencomputers/textures/items/ComponentBus3.png b/src/main/resources/assets/opencomputers/textures/items/ComponentBus3.png new file mode 100644 index 000000000..8d58a787d Binary files /dev/null and b/src/main/resources/assets/opencomputers/textures/items/ComponentBus3.png differ diff --git a/src/main/scala/li/cil/oc/Constants.scala b/src/main/scala/li/cil/oc/Constants.scala index 3eee3ce77..d64a6d8d5 100644 --- a/src/main/scala/li/cil/oc/Constants.scala +++ b/src/main/scala/li/cil/oc/Constants.scala @@ -73,6 +73,7 @@ object Constants { final val ComponentBusTier1 = "componentBus1" final val ComponentBusTier2 = "componentBus2" final val ComponentBusTier3 = "componentBus3" + final val ComponentBusCreative = "componentBusCreative" final val CPUTier1 = "cpu1" final val CPUTier2 = "cpu2" final val CPUTier3 = "cpu3" diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index a7a8efee4..ebf349a9c 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -62,11 +62,11 @@ class Settings(val config: Config) { val eepromSize = config.getInt("computer.eepromSize") max 0 val eepromDataSize = config.getInt("computer.eepromDataSize") max 0 val cpuComponentSupport = Array(config.getIntList("computer.cpuComponentCount"): _*) match { - case Array(tier1, tier2, tier3) => - Array(tier1: Int, tier2: Int, tier3: Int) + case Array(tier1, tier2, tier3, tierCreative) => + Array(tier1: Int, tier2: Int, tier3: Int, tierCreative: Int) case _ => OpenComputers.log.warn("Bad number of CPU component counts, ignoring.") - Array(8, 12, 16) + Array(8, 12, 16, 1024) } val callBudgets = Array(config.getDoubleList("computer.callBudgets"): _*) match { case Array(tier1, tier2, tier3) => diff --git a/src/main/scala/li/cil/oc/common/init/Items.scala b/src/main/scala/li/cil/oc/common/init/Items.scala index 6864a77da..14dcbda09 100644 --- a/src/main/scala/li/cil/oc/common/init/Items.scala +++ b/src/main/scala/li/cil/oc/common/init/Items.scala @@ -540,6 +540,8 @@ object Items extends ItemAPI { registerItem(new item.DiamondChip(multi), Constants.ItemName.DiamondChip) Recipes.addSubItem(new item.UpgradeMF(multi), Constants.ItemName.MFU, "oc:mfu") + registerItem(new item.ComponentBus(multi, Tier.Four), Constants.ItemName.ComponentBusCreative) + // Register aliases. for ((k, v) <- aliases) { descriptors.getOrElseUpdate(k, descriptors(v)) diff --git a/src/main/scala/li/cil/oc/common/item/ComponentBus.scala b/src/main/scala/li/cil/oc/common/item/ComponentBus.scala index 7d03028be..867fe47fe 100644 --- a/src/main/scala/li/cil/oc/common/item/ComponentBus.scala +++ b/src/main/scala/li/cil/oc/common/item/ComponentBus.scala @@ -1,10 +1,20 @@ package li.cil.oc.common.item import li.cil.oc.Settings +import li.cil.oc.common.Tier +import li.cil.oc.util.Rarity +import net.minecraft.item.EnumRarity +import net.minecraft.item.ItemStack class ComponentBus(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier { override val unlocalizedName = super.unlocalizedName + tier + // Because the driver considers the creative bus to be tier 3, the superclass + // will believe it has T3 rarity. We override that here. + override def rarity(stack: ItemStack): EnumRarity = + if (tier == Tier.Four) Rarity.byTier(Tier.Four) + else super.rarity(stack) + override protected def tooltipName = Option(super.unlocalizedName) override protected def tooltipData = Seq(Settings.get.cpuComponentSupport(tier)) diff --git a/src/main/scala/li/cil/oc/integration/opencomputers/DriverComponentBus.scala b/src/main/scala/li/cil/oc/integration/opencomputers/DriverComponentBus.scala index 429568eee..eae787469 100644 --- a/src/main/scala/li/cil/oc/integration/opencomputers/DriverComponentBus.scala +++ b/src/main/scala/li/cil/oc/integration/opencomputers/DriverComponentBus.scala @@ -15,15 +15,17 @@ object DriverComponentBus extends Item with Processor { override def worksWith(stack: ItemStack) = isOneOf(stack, api.Items.get(Constants.ItemName.ComponentBusTier1), api.Items.get(Constants.ItemName.ComponentBusTier2), - api.Items.get(Constants.ItemName.ComponentBusTier3)) + api.Items.get(Constants.ItemName.ComponentBusTier3), + api.Items.get(Constants.ItemName.ComponentBusCreative)) override def createEnvironment(stack: ItemStack, host: EnvironmentHost) = null override def slot(stack: ItemStack) = Slot.ComponentBus + // Clamp item tier because the creative bus needs to fit into tier 3 slots. override def tier(stack: ItemStack) = Delegator.subItem(stack) match { - case Some(bus: item.ComponentBus) => bus.tier + case Some(bus: item.ComponentBus) => bus.tier min Tier.Three case _ => Tier.One }