Jump to content

Recommended Posts

Posted (edited)

As mentioned in the title, I noticed that whenever I used the recommended method to initializing custom saplings/plants with the flower pot block, it never allows me to add said sapling to an empty pot but when I use the depreciated method it works perfectly. I also think this has been the case since its implementation, probably in 1.14?

 

Now I may not fully understand or be utilizing the supplier/getters correctly either so I'll provide my code below just incase.

 

This is my code below:

 

public static final RegistryObject<Block> POTTED_BAMBOO_SAPLING = register("potted_bamboo_sapling", () -> new FlowerPotBlock(() -> (FlowerPotBlock) Blocks.FLOWER_POT, BAMBOO_SAPLING::get, AbstractBlock.Properties.create(Material.MISCELLANEOUS).zeroHardnessAndResistance()));

 

Edited by diesieben07
fix format
Posted

Thanks for that! Figured it out, might not be the cleanest way to implement it but I added this to my FMLCommonSetupEvent setup like this and it works:
 

event.enqueueWork(() -> {
    ((FlowerPotBlock)Blocks.FLOWER_POT).addPlant(ExplorerBlocks.BAMBOO_SAPLING.getId(), ExplorerBlocks.POTTED_BAMBOO_SAPLING::get);
});

 

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.