-
Notifications
You must be signed in to change notification settings - Fork 1
Adding Saplings
Adding a sapling to a tree created with a tree tweaker script is a simple as calling .addSapling(). Take this example script which creates a new tree (using the default log and leaves) named "fluke_tree" and and creates a sapling for it:
#loader preinit
import mods.treetweaker.TreeFactory;
var newtree = TreeFactory.createTree("fluke_tree");
newtree.setTreeType("PALM");
newtree.addSapling();
newtree.register();
Users must provide their own textures for created saplings. Texture names must match the name of the tree provided in createTree (must be all lowercase). Textures should be placed in at minecraft\resources\treetweaker\textures\. The folder structure will be created for you the first time a script containing addSapling() is run.
Continuing our example script above, I have created a new 16x16 px image at minecraft\resources\treetweaker\textures\fluke_tree.png
Users must also add an entry to the lang file to give the sapling a proper name in game. For English names, create a text file called en_us.lang at the location minecraft\resources\treetweaker\lang\. In this file we need to add an entry for each the new sapling with the format tile.treetweaker.<treename>.name=In Game Name.
For the example script above, I've created the file minecraft\resources\treetweaker\lang\en_us.lang and added an entry which looks like tile.treetweaker.fluke_tree.name=Fluke's Tree
