Jump to content

Custom Tree leaves decaying (with Vanilla logs & leaves)


Xombifier

Recommended Posts

I've looked at this post already, in which the person is using custom Log and Leaves blocks with their tree - and the understanding is they have to add their blocks to their proper tags and all that.

Well, I made a custom tree that uses Vanilla blocks: Blocks.OAK_LOG and Blocks.OAK_LEAVES (please let me know if this is a silly thing to do with a custom tree). What is happening when I go into my world is I see the tree generating, and initially it looks something like this. But after a while, it levels out to looking like this, and the leaves have stopped disappearing at this point.

 

So I don't think it is a problem with tags or anything, but possibly a limit on how far of a radius leaves can exist from a log block?

 

public class MassiveTree extends Tree {

	public static final TreeFeatureConfig MASSIVE_TREE_CONFIG = (new TreeFeatureConfig.Builder(
			new SimpleBlockStateProvider(Blocks.OAK_LOG.getDefaultState()),
			new SimpleBlockStateProvider(Blocks.OAK_LEAVES.getDefaultState()), new BlobFoliagePlacer(2, 2)))
					.baseHeight(13).heightRandA(5).foliageHeight(9).ignoreVines()
					.setSapling((net.minecraftforge.common.IPlantable) Blocks.OAK_SAPLING).build();

	@Override
	protected ConfiguredFeature<TreeFeatureConfig, ?> getTreeFeature(Random randomIn, boolean p_225546_2_) {
		// TODO Auto-generated method stub
		return Feature.NORMAL_TREE.withConfiguration(MASSIVE_TREE_CONFIG);
	}

 

Edited by Xombifier
Link to comment
Share on other sites

I believe this may be caused by the DISTANCE property in LeavesBlock. It looks at though it only checks for a tree trunk that far from the leaves, so once you get past 7 (default value) they start to decay.

 

Ran into this when messing with learning how to make trees, but never bothered to fix it once I discovered what was going on. :)

Link to comment
Share on other sites

5 hours ago, Ugdhar said:

I believe this may be caused by the DISTANCE property in LeavesBlock. It looks at though it only checks for a tree trunk that far from the leaves, so once you get past 7 (default value) they start to decay.

 

Ran into this when messing with learning how to make trees, but never bothered to fix it once I discovered what was going on. :)

Ah, that makes sense! I thought it was something along those lines.

Do you know of a way to extend this radius so that wider trees can be used?

Link to comment
Share on other sites

Unfortunately, I believe your only approach is to have either a custom leaf block (because you can't override the properties of vanilla blocks) or a custom log block which would set nearby leaves to non-persistent when it is removed, and generate the leaves with persistent set (which would be more prone to bugs such as breaking player placed leaves, or leaving behind leaves if the player breaks the link between the leaves and the trunk).

Link to comment
Share on other sites

2 hours ago, Alpvax said:

Unfortunately, I believe your only approach is to have either a custom leaf block (because you can't override the properties of vanilla blocks) or a custom log block which would set nearby leaves to non-persistent when it is removed, and generate the leaves with persistent set (which would be more prone to bugs such as breaking player placed leaves, or leaving behind leaves if the player breaks the link between the leaves and the trunk).

Okay, I think I will try creating a custom leaf block then - it seems like my best option. Thanks!

Link to comment
Share on other sites

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.