Actual fix for ladder datagen

This commit is contained in:
DBotThePony 2025-03-18 00:02:31 +07:00
parent 2f1b698810
commit dec8aab382
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 10 additions and 7 deletions

View File

@ -124,27 +124,28 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
fun simpleLadder(vararg blocks: Block): MatteryBlockStateProvider { fun simpleLadder(vararg blocks: Block): MatteryBlockStateProvider {
for (block in blocks) { for (block in blocks) {
exec { exec {
val mdl = models().getExistingFile(modLocation("block/${block.registryName!!.path}"))
getVariantBuilder(block) getVariantBuilder(block)
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.NORTH) .partialState().with(HorizontalDirectionalBlock.FACING, Direction.NORTH)
.modelForState() .modelForState()
.modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) .modelFile(mdl)
.addModel() .addModel()
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.SOUTH) .partialState().with(HorizontalDirectionalBlock.FACING, Direction.SOUTH)
.modelForState() .modelForState()
.modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) .modelFile(mdl)
.rotationY(180) .rotationY(180)
.addModel() .addModel()
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.WEST) .partialState().with(HorizontalDirectionalBlock.FACING, Direction.WEST)
.modelForState() .modelForState()
.modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) .modelFile(mdl)
.rotationY(270) .rotationY(270)
.addModel() .addModel()
.partialState().with(HorizontalDirectionalBlock.FACING, Direction.EAST) .partialState().with(HorizontalDirectionalBlock.FACING, Direction.EAST)
.modelForState() .modelForState()
.modelFile(models().getExistingFile(modLocation("block/${block.registryName!!.path}"))) .modelFile(mdl)
.rotationY(90) .rotationY(90)
.addModel() .addModel()
} }

View File

@ -53,10 +53,12 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
} }
fun decorativeLadder(block: Block) { fun decorativeLadder(block: Block) {
exec {
withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder")) withExistingParent(block.registryName!!.path, ResourceLocation("minecraft", "block/ladder"))
.texture("texture", modLocation("block/decorative/${block.registryName!!.path}")) .texture("texture", modLocation("block/decorative/${block.registryName!!.path}"))
.renderType("cutout") .renderType("cutout")
} }
}
fun decorativeGlassAll(blocks: Collection<Block>) { fun decorativeGlassAll(blocks: Collection<Block>) {
for (block in blocks) { for (block in blocks) {