Posted January 19Jan 19 Hello, Can anyone provide some pointers on generating TallFlowerBlocks using Datagen? I have only been successful generating a two-block tall plant with the bottom block as both, the top block as both, or without any texture applied. It seems that I cannot figure out a method to call that would properly generate the (or any) blockstate profile for a TallFlowerBlock. Thank you.
January 30Jan 30 I've experienced a similar issue. I haven't seen your code, but if you enter this inModBlockStateProvider.java, it should fix the problem you're facing! I hope your problem gets resolved! makeCustomFlowerBlock(ModBlocks.CUSTOMFLOWER.get(), "customflower_bottom", "customflower_top"); public void makeCustomflowerBlock(Block block, String lowerModelName, String upperModelName) { Function<BlockState, ConfiguredModel[]> function = state -> customflowerStates(state, block, lowerModelName, upperModelName); getVariantBuilder(block).forAllStates(function); } private ConfiguredModel[] customflowerStates(BlockState state, Block block, String lowerModelName, String upperModelName) { DoubleBlockHalf blockHalf = state.getValue(TallFlowerBlock.HALF); List<ConfiguredModel> models = new ArrayList<>(); if (blockHalf == DoubleBlockHalf.LOWER) { models.add(new ConfiguredModel(models().cross(lowerModelName, new ResourceLocation(TutorialMod.MOD_ID, "block/" + lowerModelName)).renderType("cutout"))); } else if (blockHalf == DoubleBlockHalf.UPPER) { models.add(new ConfiguredModel(models().cross(upperModelName, new ResourceLocation(TutorialMod.MOD_ID, "block/" + upperModelName)).renderType("cutout"))); } return models.toArray(new ConfiguredModel[0]); } modblocks.java : public static final RegistryObject<Block> CUSTOMFLOWER = registerBlock("customflower", () -> new TallFlowerBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.PEONY).noOcclusion().noCollission())); Edited January 30Jan 30 by U_Worm
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.