#Datagen Questions

2 messages · Page 1 of 1 (latest)

patent island
#

When using dataggen to make stairs for a block type, alongside slabs for the same block, I always get a duplicate model definition for the stairs. I am quite sure this issue comes from genning both stairs and slabs, as removing either of those from my datagen, (as in keeping the stair gen, removing the slab or the other way round) makes it work, I also noticed thrunning the slab datagen ends up creating Json files for the stairs, although theese dont actually work in rendering the stairs in-game.

Heres the datagen code (Im following Kaupenjoe's tutorials on fabric modding)

public class ModModelProvider extends FabricModelProvider {
    public ModModelProvider(FabricDataOutput output) {
        super(output);
    }

    @Override
    public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
        blockStateModelGenerator.registerRotatable(ModBlocks.MOSS_STONE);
        blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.CHISELED_MOSS_STONE);
        //Moss stone pillar is done manually cuz idk how to make a pillar here :(
        BlockStateModelGenerator.BlockTexturePool mossStoneBricksPool = blockStateModelGenerator.registerCubeAllModelTexturePool(ModBlocks.MOSS_STONE_BRICKS);
        //removing either of theese will make the datagen go through
        mossStoneBricksPool.stairs(ModBlocks.MOSS_STONE_BRICK_STAIRS);
        mossStoneBricksPool.slab(ModBlocks.MOSS_STONE_BRICK_SLAB);
        mossStoneBricksPool.wall(ModBlocks.MOSS_STONE_BRICK_WALL);
    }

//item model gen would also go here but it made the message too long

}

Error:
Caused by: java.lang.IllegalStateException: Duplicate model definition for mossyvalleys:block/moss_stone_brick_stairs

Also if anyone knows how to make pillars though datagen that'd also be very helpfull

(also heres the full github repo, just in case: https://github.com/nLeww/Mossy-Valleys )

GitHub

Contribute to nLeww/Mossy-Valleys development by creating an account on GitHub.

thin forum
#

It seems you set the wrong ID for the slab in ModBlocks.java, it's incorrectly named moss_stone_brick_stairs instead of moss_stone_brick_slab