Giant Trees
Giant Trees
Giant Trees is a plugin for adding procedurally generated giant trees to your world. Giant trees are generated in three ways:
- Giant trees are grown in creative/survival mode by planting saplings and fertilizing with bone meal
- Giant trees are summoned with a command
- Giant trees naturally grow when new forested biomes spawn
Tutorials in other languages:
Planting Giant Trees
To plant a giant tree in creative/survival mode, perform the following steps:
- Flatten a 5x5 area of dirt
- Surround an emerald block with two rings of saplings
- Fertilize a sapling with a stack of 64 bone meal
- Stand back
The type of sapling fertilized will determine the species of giant tree that grows.
Commands
To create a giant tree with a command, use the /tree-create or /gt command, followed by the name of the tree. Tree names are found in the plugin's data directory. For example, to summon a giant acacia tree, use the command
/gt tree.ACACIA
To edit the model for an existing tree, or create a new tree model, use the /tree-edit command. This command can only be used from the server console.
/tree-edit tree.ACACIA
Naturally Growing Trees
By default, Giant Trees will grow naturally in newly generated chunks in the default overworld (the world called "world"). To add giant trees to more worlds, increase the frequency of tree growth, or disable natural tree growth altogether, edit the plugin's config.yml.
Tree Species
For the beta the following species of trees can be summoned with the /gt command:
- tree.ACACIA
- tree.BIRCH
- tree.DARK_OAK
- tree.JUNGLE
- tree.OAK
- tree.SPRUCE
More tree species will be added in future releases.
Undoing Giant Trees
Trees summoned with the /gt command can be undone using WorldEdit's //undo
command. This feature is automatically enabled if WorldEdit is installed.
Making Your Own Giant Tree Species
You can make your own species of giant tree. Start by using the /tree-edit command from the server console, giving it the name of the tree you want to edit or create. (For new trees, ignore the file not found error). As an alternative, you can double-click the Giant Trees plugin .jar file to start the visual tree editor.
Design your tree using the visual tree editor. When you are done, click save and exit the visual editor. To add roots to your tree, create another tree with the same name as your tree, with .root added to the end. For example, /tree-edit tree.ACACIA.root. Root trees are rendered upside down in the world and scaled to match their tree.
Is your new tree really awesome? If so, PM me the model and I'll include it in the next version of the plugin.
Permissions
- gianttrees.create (default OP) - Allows the creation of a giant tree using the tree-create command.
- gianttrees.grow (default true) - Allows a player to grow a giant tree by fertilizing a grid of saplings.
Source Code/Issues
https://github.com/rmichela/GiantTrees
Metrics
This plugin utilizes Hidendra's plugin metrics system. the following information is collected and sent to mcstats.org unless opted out:
- A unique identifier
- The server's version of Java
- Whether the server is in offline or online mode
- Plugin's version
- Server's version
- OS version/name and architecture
- core count for the CPU
- Number of players online
- Metrics version
Opting out of this service can be done by editing plugins/Plugin Metrics/config.yml and changing opt-out to true.
@CMahaff
Awesome, glad to be of help! I'm self-learning too, but quite a bit behind you... Converting old plugins to the new event and config systems and making other similar small changes is the extent of my abilities right now. :)
Can't wait to see if the fix helps!
@Darkhand81
Oh okay. Well let me know how it turns out :) Just from experience, you may need to "prune" your tree a bit as they tend to come out a bit square as you increase the size.
But this is interesting: "The concurrent collector will throw an OutOfMemoryError if too much time is being spent in garbage collection." Looking at my code I see I'm creating a local variable type Block and Material each loop through. I imagine if this runs repeatedly very quickly it might not be able to garbage collect fast enough and you'd get your error. It explains why slowing it down works too. Relevant source if you are interested/a programmer: https://github.com/CMahaff/Giant-Trees/blob/master/src/com/connormahaffey/GiantTrees/TreeBuilder.java
Very simple fix, very dumb mistake. I am a self-learner and I hadn't really learned a whole lot about memory management going into this. I can have a fix up tomorrow, will take 10 seconds. I can't guarantee it will fix the problem but it might. Thanks for letting me know and being so helpful :)
@CMahaff
That's a lot of garbage cleanup :)
I'm actually only needing a single gigantic tree, to carve a town into. :) I'm going to let the build-delayed tree run overnight and see how it goes... I'm not running completely out of memory, but hitting the garbage collection overhead limit... Here's Sun's take on it:
"The concurrent collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line."
Since I only need the one ginormous tree, I'll also try running the server with that command line argument during 'build time' and see how it goes.
@Darkhand81
It's a possibility. Again, it probably won't be fixed until I port the plugin to the new Minecraft Official API that is on the horizon. I'm sorry, but it just wouldn't be worth it. About the time I'd have re-written it, it would come out.
And to be honest, I never really planned for trees that big! I mean, when I made the plugin, the largest tree from ground level was like 60 blocks top. The new world height is a whole other beast.
I'm sorry you're having problems though. Since changing the build speed affects the outcome, I have to wonder if Bukkit is at fault and not my plugin. Or maybe if Garbage Collection just isn't fast enough at full speed....
If you REALLY want I could send you a build with force garbage collection at the end of every build loop, but, um, Bukkit may explode. Just a warning. But it's something we could try.
@CMahaff
4 gigs; I get to about the last 50% of the canopy and lose it.
Setting the build delay to 1 or 2 makes a huge difference... the server seems to be holding up well so far, but it's also going to take hours to build one tree. Would a hybrid system work? i.e., build at full speed for a few dozen ticks, take a break, repeat.
@Darkhand81
Well because this plugin has to load thousands of blocks into memory at once, it is and always will be an issue. It's really not anything I can fix without an entire re-code :/ and even then, it would still use a lot of memory.
I don't think anything is up, just keeping track 10,000 blocks is very hard on the server.
Maybe when the new Minecraft API comes out I can try and make it better for the port, maybe by loading the blocks in slowly and building the tree in parts. As it is now, it grabs all the blocks that will be the outline of the tree and changes them in one go. That takes massive amounts of memory.
Just out of curiosity, how much memory does your server have?
Any manually made large trees (96, 128, anything that seems to go over the old 128 height limit, though I haven't confirmed that yet) is failing with:
[SEVERE] Unexpected exception java.lang.OutOfMemoryError: GC overhead limit exceeded
Just to see if I can finish one tree I may try disabling the garbage collection overhead limit option in Java as a workaround, but something's up!
@darkcloud784
Well that's a problem, values don't work well with permissions. If I did it like that I'd literally have to check every single possible value:
If(player.hasPermission(gt.35)){} If(player.hasPermission(gt.36)){} If(player.hasPermission(gt.37)){} If(player.hasPermission(gt.38)){} etc...
But you can set limits height/width in your config file: https://github.com/CMahaff/Giant-Trees/wiki/Settings
Then, as admin, just give yourself the gianttrees.nolimit permission so you, personally, can make them as big as you want.
You should set a build height permission then. IE gt.35 can only build a 35 block high tree
@darkcloud784
Well its tough because it has to load all those blocks into memory. There really isn't much I can do. A possibility would have been to make different parts separately, but it's too late to change that in the code now. I know this plugin is quite resource intensive. Maybe I can make it better when the Minecraft Mod API comes out.
@CMahaff
yea, i figured that out, but making a tree takes ALOT of ram, anyway you can use some sort of caching to reduce RAM usage?
@darkcloud784
It should support jungle type by using "jungle" where you'd normally use "birch", etc.
So yes :)
Does this support jungle trees now?
nvm im an idiot... it does....
When making a tree however, it does take ALOT of ram....
Nice. I love my giant trees! Hidden houses FTW
Running on latest CB dev build.
Just awesome, simply awesome. I thought I had built my city in the jungle trees until I grew a Giant Tree! LOL
If I could only move my city into the interior now, sigh. Much work to do now to build the hidden city within a tree!
@darkcloud784
Did you get any errors?
@CMahaff
about 5 minutes....
@darkcloud784
It may take some time for it to complete the undo. How long did you wait?
/gt undo doesnt seem to undo anything with larger trees IE trees that are above the old 128 building limit. It says "starting to undo" or whatever but it doesnt acatually undo it.
newest gt version and bukkit version.
@Galexrt
Should work fine with 1.2.3. Plugins do not need to be updated every build unless something breaks - and nothing should have. In fact, I already coded in jungle support when I released for 1.1.
Enjoy.