Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • 2 weeks later...

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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.