Posted March 4, 201411 yr I want to add some trees to minecraft and for this purpose I need to know, how to generate them into the World properly, one time when generating a new Chunk, the other time when growing saplings. Can you tell me how to do this? http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 4, 201411 yr 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...
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.