From dec8aab382d59b8cbb79c0c2070246878efbb68a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 18 Mar 2025 00:02:31 +0700 Subject: [PATCH] Actual fix for ladder datagen --- .../mc/otm/datagen/blocks/MatteryBlockStateProvider.kt | 9 +++++---- .../mc/otm/datagen/models/MatteryModelProvider.kt | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt index 4f628d2c8..2de6c5c62 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt @@ -124,27 +124,28 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve fun simpleLadder(vararg blocks: Block): MatteryBlockStateProvider { for (block in blocks) { exec { + val mdl = models().getExistingFile(modLocation("block/${block.registryName!!.path}")) getVariantBuilder(block) .partialState().with(HorizontalDirectionalBlock.FACING, Direction.NORTH) .modelForState() - .modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) + .modelFile(mdl) .addModel() .partialState().with(HorizontalDirectionalBlock.FACING, Direction.SOUTH) .modelForState() - .modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) + .modelFile(mdl) .rotationY(180) .addModel() .partialState().with(HorizontalDirectionalBlock.FACING, Direction.WEST) .modelForState() - .modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) + .modelFile(mdl) .rotationY(270) .addModel() .partialState().with(HorizontalDirectionalBlock.FACING, Direction.EAST) .modelForState() - .modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) + .modelFile(mdl) .rotationY(90) .addModel() } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt index 683931e9c..c49fc39bc 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt @@ -53,9 +53,11 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve } fun decorativeLadder(block: Block) { - withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder")) - .texture("texture", modLocation("block/decorative/${block.registryName!!.path}")) - .renderType("cutout") + exec { + withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder")) + .texture("texture", modLocation("block/decorative/${block.registryName!!.path}")) + .renderType("cutout") + } } fun decorativeGlassAll(blocks: Collection) {