Jump to content

Recommended Posts

Posted (edited)

There is something about DecoratedFeatureConfig.

It looks like, it get´s flowers to place, that came into the biome this way

But i don´know, how to get my tulips with DecoratedFeatureConfig into the biomes...

Actualy i use BlockClusterFeatureConfig.

Edited by Drachenbauer
Posted

Iow i found out, that ForestFlowerBlockStateProvider and PlainFlowerBlockStateProvider use blockstate-lists, wich include the vanilla-tulips.

 

Is there any way to pass my own list:

    private static final BlockState[] TULIPS_BLOCKSTATES = new BlockState[]
    {
        Blocks.RED_TULIP.getDefaultState(),
        Blocks.ORANGE_TULIP.getDefaultState(),
        Blocks.WHITE_TULIP.getDefaultState(),
        Blocks.PINK_TULIP.getDefaultState(),
        
        MoreTulipsBlocks.BLACK_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.BLUE_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.BROWN_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.CYAN_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.GRAY_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.GREEN_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.LIGHT_BLUE_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.LIGHT_GRAY_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.LIME_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.MAGENTA_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.PURPLE_TULIP.get().getDefaultState(),
        MoreTulipsBlocks.YELLOW_TULIP.get().getDefaultState(),
    };

into theese providers or should i register my own BlockStateProvider

Posted

So I was looking at some vanilla code, and noticed if you trace back from GrassBlock, you see in the grow method that there's a call to a biome getFlowers(). If you look at that method, you see it returns the biome's flowers. In Eclipse, you can right click on a method, and select "Open Call Heirarchy". This shows places where this is accessed, and doing this to the flowers field in the biome, it shows me it's accessed in the addFeature method of Biome. THIS shows me when a feature is added via addFeature, if the feature is Feature.DECORATED_FLOWER, it adds that to the list of flowers.

 

Your feature is of type Feature.FLOWER. What happens if you change it?

 

I showed you my trail of thought/research, in hopes it will help you with backtracing through the code to find what you're looking for. Learn how to use the features of your IDE to help you. :)

Posted (edited)

I already used that backtracing and found, what you say, but i cannot find, where  DECORATED_FLOWER get´s the flowers from, and i found nothing there, where code in my own classes can access.

 

so i now create my own bonemeal, that manually adds my tulips, if the clicked grass-block is in one of the three vanilla-biomes with tulips.

I make it the way, how my bick blocks in the other mod add their invisible part-blocks to the world, if placed.

At first i let it find random positions in a 9x9 square around the clicked grass-blocks and find te surface of the ground there and then it should place random tulips there, if a grassblock is below and the position, itself has just air or a plant (but not a tree or a tulip).

It just needs a little bugfix and i think, i find the solution.

 

Edit:

I fixed it.

My custom bonemeal now makes alot of colorful tulips grow.

 

now i think, i can pack my mod.

 

But i have one last question:

How can i make the vanilla bonemeal use this behavior?

Edited by Drachenbauer
Posted

This is now my
custom bonemeal class:

  Reveal hidden contents

How can i make the vanilla BoneMealItem-class use my custom methods and the custom added part of the applyBonemeal-method here after it´s normal rightclick-behavior?

 

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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