mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-25 05:01:50 -04:00
models: also generate parent models
This commit is contained in:
parent
1e4a377812
commit
6a4132f5b0
@ -11,9 +11,17 @@ object ModelsGenerator : Generator(
|
||||
override fun generate() {
|
||||
for (model in MODELS_TO_GENERATE) {
|
||||
val resourceLocation = ResourceLocation(model)
|
||||
|
||||
data.add(resourceLocation.toString(), Util.readJsonMinecraftResource("assets/${resourceLocation.namespace}/models/${resourceLocation.path}.json"))
|
||||
loadModel(resourceLocation)
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadModel(resourceLocation: ResourceLocation) {
|
||||
val modelJson = Util.readJsonMinecraftResource("assets/${resourceLocation.namespace}/models/${resourceLocation.path}.json")
|
||||
modelJson["parent"]?.let {
|
||||
loadModel(ResourceLocation(it.asString))
|
||||
}
|
||||
data.add(resourceLocation.toString(), Util.readJsonMinecraftResource("assets/${resourceLocation.namespace}/models/${resourceLocation.path}.json"))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user