Reforestation
If you're anything like me, when you're playing Minecraft wood is in a constant demand. So, you go and cut down some trees from a forest, right? That means a few less trees for the forest. The trees do drop saplings, but do you really take the time to replant them every single time? How about other people on your server? If you're not careful, serious deforestation can occur, leaving countless animals without a home. Remember, biodiversity shrinks with habitat loss! This problem may seem too large to tackle all by yourself, and you'd be right to think so. That's where Reforestaion comes in! A revolutionary simple plugin that lets mother nature take care of herself!
How is this possible?
Every time a sapling drops from a player or tree, if it can be planted where it lays, it will automatically be placed as a sapling block and will eventually grow into a new tree. No work required on your part!
Is it customizable?
If you're updating to v2.2.0, you have to change your itemID and blockID nodes to itemName and blockName nodes that use Bukkit materialsYes! If you edit the config file located in /plugins/Reforestaion/reforestation.xml, you can set any block and metadata combination. By default the vanilla saplings will only be added, but you can remove or add any blocks you want. This includes things like flowers and mushrooms, but also is extendable to modded saplings (when Bukkit implements a way to access those modded items though IDs or names). You can also set the delay for how often the plugin checks for saplings, which is by default every 200 ticks, or 10 seconds. The tick delay value is measured in ticks, so that means 20 ticks equals 1 second.
In this XML file you can also specify entire worlds that should be disabled as well as specific WorldGuard regions. If you would like to disable Residence regions, make sure the flag "autoplant" (which is enabled by default) is disabled in the region.
Because some users may find it difficult to change values in the config, I'll post what the reforestation.xml file will look like when it's first generated. You can open it with any text editor such as Notepad.
<?xml version="1.0" encoding="UTF-8"?>
<reforestation>
<!-- You can toggle whether the plugin is enabled or not using the command "/reforestation [on|off]" in game, but this controls if it's enabled on startup -->
<autoEnable>true</autoEnable>
<!-- This is how long the plugin waits to see if it can plant saplings. 1 second = 20 ticks -->
<tickDelay>200</tickDelay>
<!-- The following shows how to disable certain worlds
<disabled type="world">
<world>name_of_world_to_disable</world>
</disabled>
-->
<!-- This shows how to disable certain WorldGuard regions
<disabled type="region">
<world>world_that_region_is_in</world>
<region>name_of_region_to_disable</region>
</disabled>
-->
<!-- If you want to disable Residence regions, then make sure the flag "autoplant" is disabled in the region -->
<plant name="Oak">
<itemName>SAPLING</itemName>
</plant>
<plant name="Spruce">
<itemName>SAPLING</itemName>
<itemMeta>1</itemMeta>
</plant>
<plant name="Birch">
<itemName>SAPLING</itemName>
<itemMeta>2</itemMeta>
</plant>
<plant name="Jungle">
<itemName>SAPLING</itemName>
<itemMeta>3</itemMeta>
</plant>
<plant name="Acacia">
<itemName>SAPLING</itemName>
<itemMeta>4</itemMeta>
</plant>
<plant name="Dark Oak">
<itemName>SAPLING</itemName>
<itemMeta>5</itemMeta>
</plant>
<!-- Below is an example of how you would add items that plant different blocks
You can specifiy the blockName and blockMeta nodes to customize which block is placed
By default the block and metadata used are the same as the item's
<plant name="Wheat Seeds">
<itemName>SEEDS</itemName>
<blockName>CROPS</blockName>
</plant>
-->
</reforestation>
Tip: A comment is anything between
<!-- and -->Comments are completely ignored and are only there to help you.
To add more saplings, just create a new plant node, fill out the name attribute, and then add more sub-nodes. The sub-nodes you can add are: itemName, the material of the dropped item; itemMeta, the metadata of the dropped item; blockName, the material of the block that will be placed; and blockMeta, the metadata of the block that will be placed. You do not need to include itemMeta if the metadata is 0 or blockMaterial and blockMeta if those are the same as the original items.
To add a WorldGuard region where auto planting is disabled, simply uncomment out the disabled region node and change the world and region names to your own. You can add as many disabled regions as you'd like. Disabled worlds work the same way, except you don't need the plugin WorldGuard to use them, their type attribute is "world", and they don't use the region sub-node. In order to disable Reforestation in a Residence region, simply make sure the flag "autoplant" is disabled there.
If you're having trouble understanding how to change the config, please post a comment and I'll try to help you.
You can also use /reforestation [on|off] to enable or disable the plugin at any time in game. You need to have the permission node reforestation.toggle in order to use the command. If you want the plugin to be disabled when you start the server, change auto enable to false in the config.yml, or else every time you start the server the plugin will enable planting.
Why do I need this?
It's a fun plugin that adds a nice rounded feel to your server. An example of its realism is that you could start a fire that will actually help the forest grow by causing saplings to fall, just like in the real world.
How did you make such an amazing plugin?
I'm glad you asked! If you're interested in seeing how I accomplished anything, please check out the plugin's source at https://github.com/Jsnman/Reforestation
I keep getting this on my console as well...
Thu 03:22:27 PM [WARNING] [Reforestation] Task #8 for Reforestation v1.6.1 generated an exception
http://pastebin.com/nxNxF2dZ
Version 1.6.1 fixes several bugs which could cause a crash while checking the replanting status of saplings. It also has an improved world lookup system which is less system intense.
@Halomantis2
Okay, I'll try and see what's causing that.
While running this plugin, everything works but there is a spamming error on the server.
16:40:47 [WARNING] [Reforestation] Task #7 for Reforestation v1.6.0 generated an exception java.lang.NoSuchFieldError: id at me.jsn_man.Reforestation.Reforestation.check(Reforestation.java:205) at me.jsn_man.Reforestation.Reforestation.run(Reforestation.java:186) at org.bukkit.craftbukkit.v1_4_R1.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_4_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:815) at ho.r(DedicatedServer.java:301) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:773) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:660) at fy.run(ThreadMinecraftServer.java:16)
@LexaKI
I am not sure what you are saying other than the plugin makes your server crash. I've never had a server crash due to this plugin, personally.
Try running a test server with only that as the plugin and see for yourself.
Every time, when I installed this plugin, my server went down during the day. The more I use this plugin never will, and you do not advise it. Just do not say that my hands are not out of the place :)
I've just uploaded v1.6.0 which improves performance as well as adds the '/reforestation [on|off]' command. The delay value in the config is now measured in ticks instead of milliseconds, so you'll need to change that if the delay was set to anything other than 10 seconds.
@Jsn_man
Ok, I will try that, thanks for your help! :D
@dragondeatth
That's funny, because if you look at where the exceptions originate, it's his obfuscation plugin. The only mention of Reforestation is in the active plugins list and the thread list. I already have a version almost ready which doesn't need an external thread, so that shouldn't appear in v1.6. The only reason why this might be happening is because the obfuscation plugin is unaware of when my plugin plants a sapling. This may be because I use the generic world class to set the blockID and not the Bukkit API, since the code is being ran on an external thread. I'll be able to use the Bukkit API again in v1.6 as well when I don't need to use the external thread. Try running the server without the obfuscation plugin and with Reforestation for now. If it really is a fault with solely mine, then your server should crash in a manner simmilar to the last stacktrace you sent me. Either way, tell me what happens.
@Jsn_man
I asked the dev about it, and he said that wasn't Orebfuscator causing that xD
But I'm almost 100% sure it's your plugin, because I removed it, and it hasn't crashed since :-)
@dragondeatth
That's not my plugin. It looks like your ore obfuscation plugin is causing it.
This plugin crashes my server once a day:
http://pastebin.com/ZJKFXmdr
I know it's this plugin, because I recently installed a couple of new plugins and the crashes then started. In the crash log it says something messed with the entities and chunks, and of the new plugins I installed, your plugin is the only one that does that. Also when I removed it the crashes stopped. Please fix this.
Thanks - Dragon :D
Not working in 1.4.7 hope you get round to it quickly :P, thanks
@pimsserver
Not without a few modifications, and I'm not sure many people would enjoy that feature. I'll look into it, though.
Could it be possible to allow trees to drop saplings randomly? So that forests would grow if no one were to cut them back a few yards?
Okay, I've just uploaded v1.5 which should (hopefully) fix all problems. Tell me if there are any issues.
@Javatech
Interesting. I'll try to fix this inconvenience soon.
@Jsn_man
So, that seems to have cured the errors but broke replanting. I cleared enough trees to provide wood til March. None of the saplings had replanted, the ones I did toss on the ground just vanished after 10 seconds. If I toss 2 on the ground at once, they make an itemstack then take 5 minutes to despawn.. I am going to disable a few plugins and try again.
@Javatech
Hm.. That is strange. I've just uploaded a fix that should take care of that, so tell me how that works. You'll have to wait until v1.4.2 gets approved, which should be later today.
So, I went to cut some trees.. After I got done I happened to look at my console and noticed there was quite a bit of errors going on.
http://pastebin.com/G4fjEWdL