diff --git a/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/ModelsGenerator.kt b/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/ModelsGenerator.kt index 41915c0..8842900 100644 --- a/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/ModelsGenerator.kt +++ b/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/ModelsGenerator.kt @@ -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")) + + } + }