mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
computer wires
This commit is contained in:
@@ -207,12 +207,14 @@ class WireCodex {
|
||||
val invImgSheet = invImgRef[0]
|
||||
val invImgX = invImgRef[1].toInt()
|
||||
val invImgY = invImgRef[2].toInt()
|
||||
|
||||
val className = record.get("javaclass")
|
||||
val loadedClass = Class.forName(className)
|
||||
val loadedClassConstructor = loadedClass.getConstructor(ItemID::class.java, String::class.java, Int::class.java, Int::class.java)
|
||||
val loadedClassInstance = loadedClassConstructor.newInstance(prop.id, invImgSheet, invImgX, invImgY)
|
||||
ItemCodex[prop.id] = loadedClassInstance as GameItem
|
||||
|
||||
ModMgr.getJavaClass<GameItem>(modname, className,
|
||||
arrayOf(ItemID::class.java, String::class.java, Int::class.java, Int::class.java),
|
||||
arrayOf(prop.id, invImgSheet, invImgX, invImgY)
|
||||
).let {
|
||||
ItemCodex[prop.id] = it
|
||||
}
|
||||
|
||||
printdbg(this, "Setting prop ${prop.id} ->>\t${prop.nameKey}")
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class WireProp : TaggedProp {
|
||||
var inputType: String = ""
|
||||
var outputType: String = ""
|
||||
|
||||
var branching: Int = 0 // 0: can't; 1: tee-only, 2: cross-only, 3: tee and cross
|
||||
var branching: Int = 0 // 0: can't; 1: can't but can be bent, 2: tee-only, 3: cross-only, 4: tee and cross
|
||||
|
||||
/**
|
||||
* Mainly intended to be used by third-party modules
|
||||
|
||||
Reference in New Issue
Block a user