From 3311876b48ebe615dae416e19455513898c81441 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Tue, 14 Sep 2021 01:08:43 +0300 Subject: [PATCH 1/4] Bee keeper robot upgrade https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/8467 --- build.properties | 2 +- libs/gendustry-1.6.5.1-GTNH-mc1.7.10-api.jar | Bin 0 -> 20288 bytes .../opencomputers/recipes/default.recipes | 5 + .../textures/items/UpgradeBeekeeper.png | Bin 0 -> 347 bytes src/main/scala/li/cil/oc/Constants.scala | 1 + .../forestry/DriverUpgradeBeekeeper.scala | 34 +++ .../oc/integration/forestry/ModForestry.scala | 8 + .../forestry/UpgradeBeekeeper.scala | 197 ++++++++++++++++++ .../forestry/item/UpgradeBeekeeper.scala | 5 + .../opencomputers/ModOpenComputers.scala | 13 +- 10 files changed, 260 insertions(+), 5 deletions(-) create mode 100644 libs/gendustry-1.6.5.1-GTNH-mc1.7.10-api.jar create mode 100644 src/main/resources/assets/opencomputers/textures/items/UpgradeBeekeeper.png create mode 100644 src/main/scala/li/cil/oc/integration/forestry/DriverUpgradeBeekeeper.scala create mode 100644 src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala create mode 100644 src/main/scala/li/cil/oc/integration/forestry/item/UpgradeBeekeeper.scala diff --git a/build.properties b/build.properties index 9f884109b..6f5c2b16d 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -oc.version=1.7.5.13-GTNH +oc.version=1.7.5.14-GTNH ae2.version=rv3-beta-31 bc.version=7.0.9 diff --git a/libs/gendustry-1.6.5.1-GTNH-mc1.7.10-api.jar b/libs/gendustry-1.6.5.1-GTNH-mc1.7.10-api.jar new file mode 100644 index 0000000000000000000000000000000000000000..437d611241fed87aab4a40c7f34d8c3e7977b55b GIT binary patch literal 20288 zcma)E1yojB(?+_x8w8|7y1Tmt>F(~7?ru?9kZz zMo~nzsjuw`5D*s#5D+2&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f$F!1q3h-*V#d;OP(OY(RMR z2OfW~oBXi`{##OyhcbVVIsvHWzmWP{0r$5g9#13wAfW;CuOz-Z*>4S!k7e+9bngdr zDD1yN|5{-B?V~>)mHUD32KPt&-_=Qei~e~0=?6L};M*jB;QcS@|KGwsp6dAl>yPwD z*k6;>zr}sP`My6NCTG4~5Bt*v`H#5Y&hC%p_IQrwJ6MiS^}j(q%AfxBNgvOO{D7wi zd_m?9jQx9->bKaBCo6tnYoYxc_V*0NZ-F0=3;Y0HLH{H0FQ?Vt!al%!mm2YR%>Q{+ zFw8%~{uCBH7Tx29`|prBKBE5#@3+Uk-#+={zVjcH3IN{%`hygIdUEmaw&O>D{#!ba zd$)hk8N~iibbbvS|3>2>`S7^o`3H?#z_*S5@Gg(N=0iyOvp61rA9rW|0L~})Bk*@u z@!MX_#}poS0REtmNA#~0{@>62?%5wVcl|&nBl%b4Kf1Z!QF`2%^n=nk>AzC?o0t0? zg~zQbKPZp@l1+aQ@OL?USJeMCt~}=dM#@@W;jfAMjy-!LdKU z|IWqz4*YRR`v*8OpkD9?@LxRK?@%AtU4Ni<044+ffcmS0`yK4#GTsl^en3_453qlE zjc;4^`>5yd&>z=IexP?U{u?@gBj2YPe+T_Ijs61~6fleO&kz3HCH)TfamMrqt}WXi zaewhhze9bTDg1#t1W3I6;c0(1>%W`d`W>OiDV-mLq5!R=|AEl=ZTZ80{Ep1yOv4W{ g+C2Y>%&+d_8woH#MdYF9jT#6W0dNN9d-&h~0Uehbq5uE@ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/recipes/default.recipes b/src/main/resources/assets/opencomputers/recipes/default.recipes index c4eb8359d..2280f7fed 100644 --- a/src/main/resources/assets/opencomputers/recipes/default.recipes +++ b/src/main/resources/assets/opencomputers/recipes/default.recipes @@ -244,6 +244,11 @@ batteryUpgrade3 { ["oc:capacitor", chipDiamond, "oc:capacitor"] [nuggetIron, "oc:capacitor", nuggetIron]] } +beekeeperUpgrade { + input: [[ingotGold, blockGlass, ingotGold] + ["oc:circuitChip3", {item="Forestry:beealyzer"}, "oc:circuitChip3"] + [ingotGold, "oc:materialCircuitBoardPrinted", ingotGold]] +} chunkloaderUpgrade { input: [[ingotGold, blockGlass, ingotGold] ["oc:circuitChip3", eyeOfEnder, "oc:circuitChip3"] diff --git a/src/main/resources/assets/opencomputers/textures/items/UpgradeBeekeeper.png b/src/main/resources/assets/opencomputers/textures/items/UpgradeBeekeeper.png new file mode 100644 index 0000000000000000000000000000000000000000..c22f9731e54e3744507ecbe95d924daba46eb0f6 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|y0G|-ov@>Zl|Ia-0|IExYGl63NznK2N!NA8S!^+CuvSn3RXQPam5*r(r zSyrN~xR#o%wP9kUZe*aUo4rnu7Y7Hsl8nBJJjlYfM-56qN}?plFZe%pz;ISr?-fuD zXMsm#F#`kNVGw3Kp1&dmC|Kd?;uxY4?0fF5RFeV^>x0%eTYNTOy7Tw`O6!J`6+bqL ze^Y#S?svb(lWW~B^QtDE2-Y|9I2F60WdYZVzf7%119c5J?#oMjP2iUJUXxE$ new UpgradeBeekeeper(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[UpgradeBeekeeper] + else null + } +} diff --git a/src/main/scala/li/cil/oc/integration/forestry/ModForestry.scala b/src/main/scala/li/cil/oc/integration/forestry/ModForestry.scala index c23dc4e9a..0bc1b94c3 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ModForestry.scala +++ b/src/main/scala/li/cil/oc/integration/forestry/ModForestry.scala @@ -1,6 +1,9 @@ package li.cil.oc.integration.forestry +import cpw.mods.fml.common.registry.GameRegistry +import li.cil.oc.Constants import li.cil.oc.api.Driver +import li.cil.oc.common.recipe.Recipes import li.cil.oc.integration.ModProxy import li.cil.oc.integration.Mods @@ -13,5 +16,10 @@ object ModForestry extends ModProxy { Driver.add(ConverterItemStack) Driver.add(new DriverAnalyzer) Driver.add(new DriverBeeHouse) + Driver.add(DriverUpgradeBeekeeper) + Driver.add(DriverUpgradeBeekeeper.Provider) + val multi = new li.cil.oc.common.item.Delegator() + GameRegistry.registerItem(multi, "item.forestry") + Recipes.addSubItem(new li.cil.oc.integration.forestry.item.UpgradeBeekeeper(multi), Constants.ItemName.BeekeeperUpgrade, "oc:beekeeperUpgrade") } } \ No newline at end of file diff --git a/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala b/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala new file mode 100644 index 000000000..aa2c27818 --- /dev/null +++ b/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala @@ -0,0 +1,197 @@ +package li.cil.oc.integration.forestry + +import java.util + +import cpw.mods.fml.common.Loader +import forestry.api.apiculture.{BeeManager, IBeeHousing} +import forestry.plugins.PluginApiculture +import li.cil.oc.Constants +import li.cil.oc.api.driver.DeviceInfo +import li.cil.oc.api.driver.DeviceInfo.{DeviceAttribute, DeviceClass} +import li.cil.oc.api.machine.{Arguments, Callback, Context} +import li.cil.oc.api.network.{EnvironmentHost, Node, Visibility} +import li.cil.oc.api.{Network, internal, prefab} +import li.cil.oc.server.component.result +import li.cil.oc.server.component.traits.{NetworkAware, SideRestricted, WorldAware} +import li.cil.oc.util.{BlockPosition, InventoryUtils} +import li.cil.oc.util.ExtendedArguments.extendedArguments +import li.cil.oc.util.ExtendedWorld._ +import net.bdew.gendustry.api.blocks.IIndustrialApiary +import net.minecraft.inventory.ISidedInventory +import net.minecraft.item.ItemStack +import net.minecraft.nbt.NBTTagCompound +import net.minecraftforge.common.util.ForgeDirection + +import scala.collection.convert.WrapAsJava._ + +class UpgradeBeekeeper(val host: EnvironmentHost with internal.Agent) extends prefab.ManagedEnvironment with DeviceInfo with WorldAware with SideRestricted with NetworkAware { + override val node: Node = Network.newNode(this, Visibility.Network). + withComponent("beekeeper", Visibility.Neighbors). + withConnector(). + create() + + private final lazy val deviceInfo = Map( + DeviceAttribute.Class -> DeviceClass.Generic, + DeviceAttribute.Description -> "BeeKeeper", + DeviceAttribute.Vendor -> Constants.DeviceInfo.DefaultVendor, + DeviceAttribute.Product -> "Breeding bees for you (almost)" + ) + + override def getDeviceInfo: util.Map[String, String] = deviceInfo + override def position: BlockPosition = BlockPosition(host) + override protected def checkSideForAction(args: Arguments, n: Int): ForgeDirection = args.checkSideAny(n) + + private def withApiary(side: ForgeDirection, f: IBeeHousing => Array[AnyRef]) = + if (host.mainInventory.getSizeInventory > 0) { + position.world.get.getTileEntity(position.offset(side)) match { + case housing: IBeeHousing => f(housing) + case _ => result(false, "Not facing an apiary") + } + } + else result(false, "No inventory?") + + @Callback(doc = """function(side:number):boolean -- Swap the queen from the selected slot with the apiary at the specified side.""") + def swapQueen(context: Context, args: Arguments): Array[AnyRef] = { + val facing = checkSideForAction(args, 0) + withApiary(facing, housing => { + val selected = host.mainInventory.getStackInSlot(host.selectedSlot) + val oldQueen = housing.getBeeInventory.getQueen + housing.getBeeInventory.setQueen(selected) + host.mainInventory.setInventorySlotContents(host.selectedSlot, oldQueen) + result(true) + }) + } + + @Callback(doc = """function(side:number):boolean -- Swap the drone from the selected slot with the apiary at the specified side.""") + def swapDrone(context: Context, args: Arguments): Array[AnyRef] = { + val facing = checkSideForAction(args, 0) + withApiary(facing, housing => { + val selected = host.mainInventory.getStackInSlot(host.selectedSlot) + val oldQueen = housing.getBeeInventory.getDrone + housing.getBeeInventory.setDrone(selected) + host.mainInventory.setInventorySlotContents(host.selectedSlot, oldQueen) + result(true) + }) + } + + @Callback(doc = """function(side:number):number -- Get current progress percent for the apiary at the specified side.""") + def getBeeProgress(context: Context, args: Arguments): Array[AnyRef] = { + val facing = checkSideForAction(args, 0) + withApiary(facing, housing => result(housing.getBeekeepingLogic.getBeeProgressPercent)) + } + + @Callback(doc = """function(side:number):boolean -- Checks if current bee in the apiary at the specified side can work now.""") + def canWork(context: Context, args: Arguments): Array[AnyRef] = { + val facing = checkSideForAction(args, 0) + withApiary(facing, housing => result(housing.getBeekeepingLogic.canWork)) + } + + @Callback(doc = """function(slot:number, honeyslot:number):boolean -- Analyzes bee in the slot, uses honey from the second slot.""") + def analyze(context: Context, args: Arguments): Array[AnyRef] = { + val inventory = host.mainInventory + val specimenSlot = args.checkSlot(inventory, 0) + val specimen = inventory.getStackInSlot(specimenSlot) + if (BeeManager.beeRoot.isMember(specimen)) + return result(false, "Not a bee") + + val honeySlot = args.checkSlot(inventory, 1) + val honeyStack = inventory.getStackInSlot(honeySlot) + if (honeyStack== null || honeyStack.stackSize == 0 || (honeyStack.getItem != PluginApiculture.items.honeydew && honeyStack.getItem != PluginApiculture.items.honeyDrop)) + return result(false, "No honey!") + + val individual = BeeManager.beeRoot.getMember(specimen) + if (!individual.isAnalyzed) { + individual.analyze + val nbttagcompound = new NBTTagCompound + individual.writeToNBT(nbttagcompound) + specimen.setTagCompound(nbttagcompound) + inventory.setInventorySlotContents(specimenSlot, specimen) + honeyStack.stackSize -= 1 + inventory.setInventorySlotContents(honeySlot, honeyStack) + } + result(true) + } + + private def findSameStack(upgrade: ItemStack, inv: ISidedInventory):Int = { + for (slot <- 2 to 5) { + val u = inv.getStackInSlot(slot) + if (u != null && u.getItem == upgrade.getItem && upgrade.getItemDamage == u.getItemDamage) + return slot + } + 0 + } + + private def findEmptySlot(inv: ISidedInventory):Int = { + for (slot <- 2 to 5) { + if (inv.getStackInSlot(slot) == null) + return slot + } + 0 + } + + @Callback(doc = """function(side:number):boolean -- Tries to add industrial upgrade from the selected slot to industrial apiary at the given side.""") + def addIndustrialUpgrade(context: Context, args: Arguments): Array[AnyRef] = { + if (!Loader.isModLoaded("gendustry")) return result(false, "Gendustry not loaded!") + val inventory = host.mainInventory + val facing = checkSideForAction(args, 0) + val upgrade = inventory.getStackInSlot(host.selectedSlot) + if (upgrade == null) return result(false, "No upgrade in selected slot") + position.world.get.getTileEntity(position.offset(facing)) match { + case ia : IIndustrialApiary => + val inv = ia.asInstanceOf[ISidedInventory] + if (!inv.isItemValidForSlot(2, upgrade)) + return result(false, "Upgrade does not fit") + + var slot = findSameStack(upgrade, inv) + if (slot == 0) + slot = findEmptySlot(inv) + + val u = inv.getStackInSlot(slot) + if (u == null) + inv.setInventorySlotContents(slot, upgrade) + else { + u.stackSize += upgrade.stackSize + inv.setInventorySlotContents(slot, u) + } + inventory.setInventorySlotContents(host.selectedSlot, null) + result(true) + + case _ => result(false, "Not facing an industrial apiary") + } + } + @Callback(doc = """function(side:number, slot: number):table -- Get industrial upgrade in the given slot of the industrial apiary at the given side.""") + def getIndustrialUpgrade(context: Context, args: Arguments): Array[AnyRef] = { + if (!Loader.isModLoaded("gendustry")) return result(Unit, "Gendustry not loaded!") + val facing = checkSideForAction(args, 0) + position.world.get.getTileEntity(position.offset(facing)) match { + case ia: IIndustrialApiary => + val inv = ia.asInstanceOf[ISidedInventory] + val slot = args.checkInteger(1) + 1 + if (slot < 2 || slot > 5) + return result(Unit, "Wrong slot index (should be 1-4)") + + result(inv.getStackInSlot(slot)) + + case _ => result(Unit, "Not facing an industrial apiary") + } + } + @Callback(doc = """function(side:number, slot: number):boolean -- Remove industrial upgrade from the given slot of the industrial apiary at the given side.""") + def removeIndustrialUpgrade(context: Context, args: Arguments): Array[AnyRef] = { + if (!Loader.isModLoaded("gendustry")) return result(false, "Gendustry not loaded!") + val facing = checkSideForAction(args, 0) + position.world.get.getTileEntity(position.offset(facing)) match { + case ia: IIndustrialApiary => + val inv = ia.asInstanceOf[ISidedInventory] + val slot = args.checkInteger(1) + 1 + if (slot < 2 || slot > 5) + return result(false, "Wrong slot index (should be 1-4)") + + val u = inv.getStackInSlot(slot) + val res = InventoryUtils.insertIntoInventory(u, host.mainInventory) + inv.setInventorySlotContents(slot, if (u.stackSize > 0) u else null) + result(res) + + case _ => result(false, "Not facing an industrial apiary") + } + } +} diff --git a/src/main/scala/li/cil/oc/integration/forestry/item/UpgradeBeekeeper.scala b/src/main/scala/li/cil/oc/integration/forestry/item/UpgradeBeekeeper.scala new file mode 100644 index 000000000..bf28172e0 --- /dev/null +++ b/src/main/scala/li/cil/oc/integration/forestry/item/UpgradeBeekeeper.scala @@ -0,0 +1,5 @@ +package li.cil.oc.integration.forestry.item + +import li.cil.oc.common.item.{Delegator, traits} + +class UpgradeBeekeeper(val parent: Delegator) extends traits.Delegate with traits.ItemTier diff --git a/src/main/scala/li/cil/oc/integration/opencomputers/ModOpenComputers.scala b/src/main/scala/li/cil/oc/integration/opencomputers/ModOpenComputers.scala index a0a27e823..f9eddae1d 100644 --- a/src/main/scala/li/cil/oc/integration/opencomputers/ModOpenComputers.scala +++ b/src/main/scala/li/cil/oc/integration/opencomputers/ModOpenComputers.scala @@ -231,7 +231,9 @@ object ModOpenComputers extends ModProxy { Constants.ItemName.TankUpgrade, Constants.ItemName.TractorBeamUpgrade, Constants.ItemName.LeashUpgrade, - Constants.ItemName.TradingUpgrade) + Constants.ItemName.TradingUpgrade, + Constants.ItemName.BeekeeperUpgrade + ) blacklistHost(classOf[internal.Drone], Constants.BlockName.Keyboard, Constants.BlockName.ScreenTier1, @@ -248,7 +250,8 @@ object ModOpenComputers extends ModProxy { Constants.ItemName.AngelUpgrade, Constants.ItemName.CraftingUpgrade, Constants.ItemName.HoverUpgradeTier1, - Constants.ItemName.HoverUpgradeTier2) + Constants.ItemName.HoverUpgradeTier2, + Constants.ItemName.BeekeeperUpgrade) blacklistHost(classOf[internal.Microcontroller], Constants.BlockName.Keyboard, Constants.BlockName.ScreenTier1, @@ -275,7 +278,8 @@ object ModOpenComputers extends ModProxy { Constants.ItemName.TankControllerUpgrade, Constants.ItemName.TractorBeamUpgrade, Constants.ItemName.LeashUpgrade, - Constants.ItemName.TradingUpgrade) + Constants.ItemName.TradingUpgrade, + Constants.ItemName.BeekeeperUpgrade) blacklistHost(classOf[internal.Robot], Constants.BlockName.Transposer, Constants.BlockName.CarpetedCapacitor, @@ -302,7 +306,8 @@ object ModOpenComputers extends ModProxy { Constants.ItemName.TankUpgrade, Constants.ItemName.TankControllerUpgrade, Constants.ItemName.LeashUpgrade, - Constants.ItemName.TradingUpgrade) + Constants.ItemName.TradingUpgrade, + Constants.ItemName.BeekeeperUpgrade) if (!WirelessRedstone.isAvailable) { blacklistHost(classOf[internal.Drone], Constants.ItemName.RedstoneCardTier2) From 772d327edc21ebd9e637194c1574f0741cf0062e Mon Sep 17 00:00:00 2001 From: repo_alt Date: Tue, 14 Sep 2021 17:45:27 +0300 Subject: [PATCH 2/4] `analyze` fixed and API changed to use selected slot --- .../li/cil/oc/integration/forestry/UpgradeBeekeeper.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala b/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala index aa2c27818..d19038550 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala +++ b/src/main/scala/li/cil/oc/integration/forestry/UpgradeBeekeeper.scala @@ -86,15 +86,15 @@ class UpgradeBeekeeper(val host: EnvironmentHost with internal.Agent) extends pr withApiary(facing, housing => result(housing.getBeekeepingLogic.canWork)) } - @Callback(doc = """function(slot:number, honeyslot:number):boolean -- Analyzes bee in the slot, uses honey from the second slot.""") + @Callback(doc = """function(honeyslot:number):boolean -- Analyzes bee in selected slot, uses honey from the specified slot.""") def analyze(context: Context, args: Arguments): Array[AnyRef] = { val inventory = host.mainInventory - val specimenSlot = args.checkSlot(inventory, 0) + val specimenSlot = host.selectedSlot val specimen = inventory.getStackInSlot(specimenSlot) - if (BeeManager.beeRoot.isMember(specimen)) + if (!BeeManager.beeRoot.isMember(specimen)) return result(false, "Not a bee") - val honeySlot = args.checkSlot(inventory, 1) + val honeySlot = args.checkSlot(inventory, 0) val honeyStack = inventory.getStackInSlot(honeySlot) if (honeyStack== null || honeyStack.stackSize == 0 || (honeyStack.getItem != PluginApiculture.items.honeydew && honeyStack.getItem != PluginApiculture.items.honeyDrop)) return result(false, "No honey!") From 17cfaf5e407f7f9c894809155ff0d4dcd4949357 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Tue, 14 Sep 2021 23:23:15 +0300 Subject: [PATCH 3/4] added species favorite temperature and humidity info --- .../scala/li/cil/oc/integration/forestry/ConverterIAlleles.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java index d89a64df3..158b4d5bc 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java +++ b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java @@ -37,5 +37,7 @@ public class ConverterIAlleles implements Converter { private void convertAlleleSpecies(final IAlleleSpecies value, final Map output) { output.put("name", value.getName()); output.put("uid", value.getUID()); + output.put("humidity", value.getHumidity().name); + output.put("temperature", value.getTemperature().name); } } From ccdd4804537787fd57ae9f57380c965fa450c19f Mon Sep 17 00:00:00 2001 From: repo_alt Date: Wed, 15 Sep 2021 01:21:43 +0300 Subject: [PATCH 4/4] fixed species converter not being registered for bees also simplified generic forestry converter --- .../forestry/ConverterIAlleles.java | 2 +- .../forestry/ConverterIIndividual.java | 60 ++++--------------- 2 files changed, 13 insertions(+), 49 deletions(-) diff --git a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java index 158b4d5bc..4a8eb49fb 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java +++ b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java @@ -34,7 +34,7 @@ public class ConverterIAlleles implements Converter { } } - private void convertAlleleSpecies(final IAlleleSpecies value, final Map output) { + static void convertAlleleSpecies(final IAlleleSpecies value, final Map output) { output.put("name", value.getName()); output.put("uid", value.getUID()); output.put("humidity", value.getHumidity().name); diff --git a/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java b/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java index 981675d44..9768b9b18 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java +++ b/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java @@ -15,19 +15,7 @@ import forestry.api.arboriculture.IAlleleLeafEffect; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.ITreeGenome; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleArea; -import forestry.api.genetics.IAlleleBoolean; -import forestry.api.genetics.IAlleleFloat; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAllelePlantType; -import forestry.api.genetics.IAlleleTolerance; -import forestry.api.genetics.IChromosome; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IIndividualLiving; +import forestry.api.genetics.*; import forestry.api.lepidopterology.EnumButterflyChromosome; import forestry.api.lepidopterology.IAlleleButterflyEffect; import forestry.api.lepidopterology.IAlleleButterflySpecies; @@ -35,6 +23,7 @@ import forestry.api.lepidopterology.IButterfly; import forestry.api.lepidopterology.IButterflyGenome; import li.cil.oc.api.driver.Converter; +import java.util.HashMap; import java.util.Map; /* @@ -73,41 +62,16 @@ public class ConverterIIndividual implements Converter { private static final Map, IAlleleConverter> converters = ImmutableMap., IAlleleConverter>builder() - .put(IAlleleFloat.class, new IAlleleConverter() { - @Override - public Object convert(IAlleleFloat allele) { - return allele.getValue(); - } - }) - .put(IAlleleInteger.class, new IAlleleConverter() { - @Override - public Object convert(IAlleleInteger allele) { - return allele.getValue(); - } - }) - .put(IAlleleBoolean.class, new IAlleleConverter() { - @Override - public Object convert(IAlleleBoolean allele) { - return allele.getValue(); - } - }) - .put(IAlleleArea.class, new IAlleleConverter() { - @Override - public Object convert(IAlleleArea allele) { - return allele.getValue(); - } - }) - .put(IAllelePlantType.class, new IAlleleConverter() { - @Override - public Object convert(IAllelePlantType allele) { - return allele.getPlantTypes(); - } - }) - .put(IAlleleGrowth.class, new IAlleleConverter() { - @Override - public Object convert(IAlleleGrowth allele) { - return allele.getProvider().getInfo(); - } + .put(IAlleleFloat.class, (IAlleleConverter) IAlleleFloat::getValue) + .put(IAlleleInteger.class, (IAlleleConverter) IAlleleInteger::getValue) + .put(IAlleleBoolean.class, (IAlleleConverter) IAlleleBoolean::getValue) + .put(IAlleleArea.class, (IAlleleConverter) IAlleleArea::getValue) + .put(IAllelePlantType.class, (IAlleleConverter) IAllelePlantType::getPlantTypes) + .put(IAlleleGrowth.class, (IAlleleConverter) allele -> allele.getProvider().getInfo()) + .put(IAlleleBeeSpecies.class, (IAlleleConverter) allele -> { + Map output = new HashMap<>(); + ConverterIAlleles.convertAlleleSpecies(allele, output); + return output; }) .build();