Skip to content

Commit

Permalink
Merge pull request #49 from GTNewHorizons/feature/configurator
Browse files Browse the repository at this point in the history
Configurator upgrade
  • Loading branch information
Dream-Master authored Feb 5, 2022
2 parents 872795c + fec38c1 commit c5903ee
Show file tree
Hide file tree
Showing 13 changed files with 538 additions and 11 deletions.
16 changes: 10 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ dependencies {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.19:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:dev") {
compile("com.github.GTNewHorizons:ForestryMC:4.4.5:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.3-GTNH:dev") {
compile("com.github.GTNewHorizons:NotEnoughItems:2.2.3-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") {
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") {
compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:waila:1.5.18:dev") {
Expand All @@ -54,7 +54,10 @@ dependencies {
compileOnly("com.github.GTNewHorizons:ExtraCells2:2.5.4:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:dev") {
compile("com.github.GTNewHorizons:EnderCore:0.2.6:dev") {
transitive = false
}
compile("com.github.GTNewHorizons:EnderIO:2.3.1.27:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Avaritiaddons:1.5.2-GTNH:dev") {
Expand All @@ -66,7 +69,6 @@ dependencies {
compileOnly("com.github.GTNewHorizons:WirelessRedstone-CBE:1.4.4:dev") {
transitive = false
}

compileOnly("appeng:RotaryCraft:V5c:api") {
transitive = false
}
Expand Down Expand Up @@ -116,6 +118,8 @@ dependencies {
compileOnly files("dependencies/ic2classic-api.zip") //curseforge one does NOT work ...
compileOnly(deobf("https://github.com/purpleposeidon/fz_archive/raw/master/old/Factorization-1.7.10-0.8.108.jar"))
compileOnly("api:coloredlightscore:1")
compileOnly(deobf("http://immibis.com/mcmoddl/files/immibis-microblocks-59.1.2.jar"))
runtime("curse.maven:cofh-core-69162:2388751")

testCompile("org.mockito:mockito-all:1.10.19")
testCompile("org.scalactic:scalactic_2.11:2.2.6")
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/opencomputers/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ item.oc.Server3.name=Server (Tier 4)
item.oc.TabletCase3.name=Tablet Case (Tier 3)
item.oc.UpgradeBeekeeper.name=Beekeeper Upgrade
item.oc.UpgradeRITEG.name=RITEG Upgrade
item.oc.UpgradeConfigurator.name=Configurator Upgrade

# Entities
entity.oc.Drone.name=Drone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ beekeeperUpgrade {
["oc:circuitChip3", {item="Forestry:beealyzer"}, "oc:circuitChip3"]
[ingotGold, "oc:materialCircuitBoardPrinted", ingotGold]]
}

configuratorUpgrade {
input: [[ingotIron, "", ingotIron]
["oc:circuitChip1", "oc:wrench", "oc:circuitChip1"]
[ingotIron, "oc:materialCircuitBoardPrinted", ingotIron]]
}

chunkloaderUpgrade {
input: [[ingotGold, blockGlass, ingotGold]
["oc:circuitChip3", eyeOfEnder, "oc:circuitChip3"]
Expand Down Expand Up @@ -710,3 +717,4 @@ appengTunnel {
type: shapeless
input: [{item="appliedenergistics2:item.ItemMultiPart", subID=460}, "oc:adapter"]
}
ritegUpgrade = false
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/main/scala/li/cil/oc/Constants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ object Constants {
final val ComponentBusTier2 = "componentBus2"
final val ComponentBusTier3 = "componentBus3"
final val ComponentBusCreative = "componentBusCreative"
final val ConfiguratorUpgrade = "configuratorUpgrade"
final val CPUTier1 = "cpu1"
final val CPUTier2 = "cpu2"
final val CPUTier3 = "cpu3"
Expand Down
7 changes: 5 additions & 2 deletions src/main/scala/li/cil/oc/common/init/Items.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import li.cil.oc.common.Loot
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.UpgradeLeash
import li.cil.oc.common.item.{Delegator, UpgradeConfigurator, 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
Expand Down Expand Up @@ -551,6 +550,10 @@ object Items extends ItemAPI {
Recipes.addSubItem(new item.WirelessNetworkCard(multi, Tier.One), Constants.ItemName.WirelessNetworkCardTier1, "oc:wlanCard1")
registerItem(new item.ComponentBus(multi, Tier.Four), Constants.ItemName.ComponentBusCreative)


// GTNH
Recipes.addSubItem(new UpgradeConfigurator(multi), Constants.ItemName.ConfiguratorUpgrade, "oc:configuratorUpgrade")

Recipes.addSubItem(new item.UpgradeRITEG(multi), Constants.ItemName.RITEGUpgrade)

// Register aliases.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package li.cil.oc.common.item

class UpgradeConfigurator(val parent: Delegator) extends traits.Delegate with traits.ItemTier
2 changes: 1 addition & 1 deletion src/main/scala/li/cil/oc/integration/Mods.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Mods {
val CraftingCosts = new SimpleMod(IDs.CraftingCosts)
val DeepStorageUnit = new ClassBasedMod(IDs.DeepStorageUnit, "powercrystals.minefactoryreloaded.api.IDeepStorageUnit")
val ElectricalAge = new SimpleMod(IDs.ElectricalAge)
val EnderIO = new SimpleMod(IDs.EnderIO, version = "@[2.2,2.3)")
val EnderIO = new SimpleMod(IDs.EnderIO, version = "@[2.2,)")
val EnderStorage = new SimpleMod(IDs.EnderStorage)
val ExtraCells = new SimpleMod(IDs.ExtraCells, version = "@[2.2.73,)")
val Factorization = new SimpleMod(IDs.Factorization)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ object ConverterItemStack extends Converter {
case stack: ItemStack if ChipsetManager.circuitRegistry.getCircuitboard(stack) != null => {
val cc = ChipsetManager.circuitRegistry.getCircuitboard(stack).getCircuits
val names = cc.collect{case c: ICircuit => c.getName}
output += "circuits" -> names
if (names.length > 0)
output += "circuits" -> names
}
case _ =>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package li.cil.oc.integration.opencomputers

import li.cil.oc.api.driver.EnvironmentProvider
import li.cil.oc.{Constants, api}
import li.cil.oc.api.driver.item.HostAware
import li.cil.oc.api.internal.Adapter
import li.cil.oc.api.network.{EnvironmentHost, ManagedEnvironment}
import li.cil.oc.common.entity.Drone
import li.cil.oc.common.tileentity.Robot
import li.cil.oc.common.tileentity.Microcontroller
import li.cil.oc.common.{Slot, Tier}
import li.cil.oc.server.component
import net.minecraft.item.ItemStack

object DriverUpgradeConfigurator extends Item with HostAware {
override def worksWith(stack: ItemStack): Boolean = isOneOf(stack,
api.Items.get(Constants.ItemName.ConfiguratorUpgrade))

override def createEnvironment(stack: ItemStack, host: EnvironmentHost) : ManagedEnvironment =
if (host.world != null && host.world.isRemote) null
else host match {
case host: EnvironmentHost with Adapter => new component.UpgradeConfigurator.Adapter(host)
case host: EnvironmentHost with Drone => new component.UpgradeConfigurator.Drone(host)
case host: EnvironmentHost with Robot => new component.UpgradeConfigurator.Robot(host)
case host: EnvironmentHost with Microcontroller => new component.UpgradeConfigurator.Microcontroller(host)
case _ => null
}

override def slot(stack: ItemStack): String = Slot.Upgrade

override def tier(stack: ItemStack): Int = Tier.Two

object Provider extends EnvironmentProvider {
override def getEnvironment(stack: ItemStack): Class[_] =
if (worksWith(stack))
classOf[component.UpgradeConfigurator.Robot]
else null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ object ModOpenComputers extends ModProxy {
api.Driver.add(DriverUpgradeTractorBeam)
api.Driver.add(DriverUpgradeTrading)
api.Driver.add(DriverUpgradeMF)
api.Driver.add(DriverUpgradeConfigurator)

api.Driver.add(DriverAPU.Provider)
api.Driver.add(DriverDataCard.Provider)
Expand Down Expand Up @@ -206,6 +207,7 @@ object ModOpenComputers extends ModProxy {

api.Driver.add(InventoryProviderDatabase)
api.Driver.add(InventoryProviderServer)
api.Driver.add(DriverUpgradeConfigurator.Provider)

blacklistHost(classOf[internal.Adapter],
Constants.BlockName.Geolyzer,
Expand Down Expand Up @@ -313,7 +315,9 @@ object ModOpenComputers extends ModProxy {
Constants.ItemName.TankControllerUpgrade,
Constants.ItemName.LeashUpgrade,
Constants.ItemName.TradingUpgrade,
Constants.ItemName.BeekeeperUpgrade)
Constants.ItemName.BeekeeperUpgrade,
Constants.ItemName.ConfiguratorUpgrade
)

if (!WirelessRedstone.isAvailable) {
blacklistHost(classOf[internal.Drone], Constants.ItemName.RedstoneCardTier2)
Expand Down
Loading

0 comments on commit c5903ee

Please sign in to comment.