mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-26 21:50:02 -04:00
make modules more dynamic
This commit is contained in:
parent
11891096fd
commit
a99fc83b9e
@ -21,10 +21,13 @@ import java.util.*
|
||||
import java.util.zip.GZIPOutputStream
|
||||
|
||||
object PixLyzer {
|
||||
private val startTime = System.currentTimeMillis()
|
||||
private val START_TIME = System.currentTimeMillis()
|
||||
val ENTITY_DATA_MAPPING = Util.readJsonResource("entities_data_mappings.json")
|
||||
val TAG_CLASS = getClass("net.minecraft.tag.Tag", "com.mojang.datafixers.types.templates.Tag")
|
||||
|
||||
val MODULES = listOf(
|
||||
"de.bixilon.pixlyzer.physics.PhysicsExtractor",
|
||||
)
|
||||
|
||||
lateinit var outputDirectory: File
|
||||
|
||||
@ -92,12 +95,14 @@ object PixLyzer {
|
||||
println("Class loading done in ${System.currentTimeMillis() - classesLoadStartTime}ms")
|
||||
|
||||
|
||||
val physics = getClass("de.bixilon.pixlyzer.physics.PhysicsExtractor")
|
||||
if (physics == null) {
|
||||
println("Physics module not found, ignoring")
|
||||
} else {
|
||||
physics.forceInit()
|
||||
physics.getDeclaredMethod("start").invoke(null)
|
||||
for (module in MODULES) {
|
||||
val clazz = getClass(module)
|
||||
if (clazz == null) {
|
||||
println("Can not find module: $module")
|
||||
continue
|
||||
}
|
||||
clazz.forceInit()
|
||||
clazz.getDeclaredMethod("start").invoke(null)
|
||||
}
|
||||
|
||||
val all: MutableMap<String, Any> = mutableMapOf()
|
||||
@ -173,7 +178,7 @@ object PixLyzer {
|
||||
println("Can not find mbf index file! Not indexing it.")
|
||||
}
|
||||
|
||||
println("Done in ${System.currentTimeMillis() - startTime}ms")
|
||||
println("Done in ${System.currentTimeMillis() - START_TIME}ms")
|
||||
}
|
||||
|
||||
fun Any.toJsonString(): String {
|
||||
|
Loading…
x
Reference in New Issue
Block a user