Jump to content

How to generate Trees?


Bedrock_Miner

Recommended Posts

You'll need to create a world generator and register it using GameRegistry.registerWorldGenerator(). Your custom sapling would then use that world generator in its overridden growTree method to replace the sapling with a tree.

 

I suggest looking into the following classes:

  • net.minecraft.item.ItemDye
  • net.minecraft.block.BlockSapling
  • net.minecraft.world.gen.feature.WorldGenTrees

 

Relevant methods regarding the sapling are markOrGrowMarked() and growTree().

 

I suppose things changed with 1.7.x, and since I have not updated yet, I cannot give further leads. However, I guess it's still not as easy as simply creating a new BlockSapling and overriding those two methods. You'll have to examine the applyBonemeal() method of the ItemDye class to find the best way...

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.