mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -04:00
Merge pull request #3534 from repo-alt/feature/Forestry_circuit_boards
Forestry circuit boards internal layout
This commit is contained in:
commit
b381aa5190
@ -2,6 +2,7 @@ package li.cil.oc.integration.forestry
|
|||||||
|
|
||||||
import java.util
|
import java.util
|
||||||
|
|
||||||
|
import forestry.api.circuits.{ChipsetManager, ICircuit}
|
||||||
import forestry.api.genetics.AlleleManager
|
import forestry.api.genetics.AlleleManager
|
||||||
import li.cil.oc.api.driver.Converter
|
import li.cil.oc.api.driver.Converter
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
@ -12,6 +13,12 @@ object ConverterItemStack extends Converter {
|
|||||||
override def convert(value: scala.Any, output: util.Map[AnyRef, AnyRef]): Unit = value match {
|
override def convert(value: scala.Any, output: util.Map[AnyRef, AnyRef]): Unit = value match {
|
||||||
case stack: ItemStack if AlleleManager.alleleRegistry.isIndividual(stack) =>
|
case stack: ItemStack if AlleleManager.alleleRegistry.isIndividual(stack) =>
|
||||||
output += "individual" -> AlleleManager.alleleRegistry.getIndividual(stack)
|
output += "individual" -> AlleleManager.alleleRegistry.getIndividual(stack)
|
||||||
|
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}
|
||||||
|
if (names.length > 0)
|
||||||
|
output += "circuits" -> names
|
||||||
|
}
|
||||||
case _ =>
|
case _ =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user