NoFloatingTrees
NoFloatingTrees
Description
This plugin will try to remove any logs that are left floating in the air when a player cuts down a tree so that the leaves can decay. Floating leaves are a pet hate of mine and the current ways to tackle them seem to either involve giving the player lots of easy free wood or take up an awful lot of admin time.
Any tree that has been partially cut down will decay over time as leaves normally do 40 seconds after being cut. A log that decays naturally will have a 15% chance of dropping an item, this should discourage people from cutting down trees and then waiting for them to fall. All of these chances and timings can be changed via the config file.
If you have the LogBlock plugin installed, any blocks that this removes will be logged as the user NoFloatingTrees. Note this this will only work on trees that are cut down when the plugin is installed, there is not much that can be done about existing ones :(
Bug Reports / Suggestions
If you find a bug, encounter a problem or have a suggestion, please fill out a ticket via the Tickets link above. I do not have the time to read through the comments section, any comment that fits the previous three categories will be ignored.
Commands
/nft queue - Prints the number of blocks currently in the decay queue. To use this command you must have the nofloatingtrees.queue.size permission which also defaults to OPs only.
/nft purge - Used to removed all floating trees regardless of how close a player is. To use this command you must have the nofloatingtrees.queue.purge permission which defaults to OPs only.
Config
Default
use-logblock: true ignore-worlds: - world_nether - world_the_end decay: frequency: 2 wait-time: 40 chance: 15 drop-chance: 15
use-logblock
If this is set to false blocks removed by the plugin will not be logged even if LogBlock is found.
ignore-worlds
If you have worlds where people can't (or just don't) cut down trees you should list them here, this will improve performance slightly.
decay
frequency
How often floating logs should try to decay, in seconds.
wait-time
How long a log should stay floating before starting to decay, also in seconds.
chance
How likely it is for a low to decay per try this is a percentage so setting it to 100 will cause the entire tree to vanish in one go.
drop-chance
Similar to the above except this controls how likely it is for a decaying log to drop an item.
Contributing
Contributions to the project are very much welcome, if you have a feature that you want implemented and know a nice way to do it then consider forking the repo and submitting a pull request. These will be accepted as long as the following simple guidelines are followed.
- Do not edit the structure of the pom.xml file, feel free to add a dependency if you need it but the formatting and structure should not be changed.
- If you are exposing a new API method, add a JavaDoc comment to it, but don't over-comment internal code.
- Follow the existing code style, don't antagonise over every space though !
All dependencies that are used are now available from a public Maven repo, so you don't have to worry about building several other projects just to add a simple change any more.
Source Code
Dev Builds
Changes Since Last Release
Download
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
http://bukkit.jacekk.co.uk:8000/job/NoFloatingTrees/
I've had same issues as elias has. Leaves won't decay by themselves after the logs have disappeared.
@elias1979
I've never seen that :/ This does nothing to the leaves at all, the game should decay them as normal. Sometimes it can take a while for a single block to be removed for some reason but it should happen eventually.
@wide_load
Not always i did have hanging leaf blocks in the air, if you remember LyTreeHelper it did have the option to drop all leaf blocks instantly, if that's is to extreme maybe the ability to set leaf block decay time.
@elias1979
What do you mean ? The leaf blocks should decay once all the logs have as they normally would.
@wide_load
Ok, the logs work, but not the leaf blocks, is that something you could add ? and maybe apple chances ?
@elias1979
Try doing something that you have not tried yet.
I can't get it to work.
@xclucky
Just subscribe to file updates. I won't be doing any numerical performance tests.
@wide_load
Alright, tell me when you have more information for me. I'd love to stay updated :)
@MasterKitty0102
There are checks that should prevent buildings being removed, they might not be perfect though. I'm certainly not making any promises on tree houses :P I doubt that there would be any real performance hit but I've never tested it tbh.
Does the plugin recongize structures? I just needs a heads up before jumping into this. Also, is it RAM hungry? Don't want to jump in, having my players structures decay ^_^ Thanks.
@zAaronzz
@xclucky
It could be to do with the way only loaded chunks are processed now. I'll do some testing.
@xclucky
Soon.
This plugin does not seem to be doing as good of a job at removing floaters as it used to. I keep finding floating oak trees (big ones) and branches of jungle trees littered EVERYWHERE. Also, is there any word on the addition of the replanting saplings feature? Thanks :D
@wide_load
This plugin seems perfect for what I wanted, but I cannot get it to work. I downloaded your latest build from the build site and I tried everything in the config file and tested breaking trees but I cannot get anything to work. What am I doing wrong?? I even tried /nft debug and It would say that there are logs in the queue but when I do /nft purge true it doesnt do anything.
Seems to work fine now. Thanks :D
@wide_load
I'll try to redownload, I only have the one version in the plugins folder.
@xclucky
Do you have two versions in the plugins folder ? Or could you have downloaded while it was still building ?
@wide_load
I do still notice a memory leak, nowhere near as bad as before. It starts out at 5.0MB/s increase for the first minute gradually decreasing to 0.1MB/s where it remains a constant increase of 0.1MB/s for the remainder of the server uptime. Although, the memory leak still persists even after removing NFT, which leads me to believe it is Craftbukkit or Minecraft related. There appears to no longer be any confliction between NFT and NoLagg. However, there is the possibility that all of these results are because NFT failed to load, according to the error below:
EDIT: THIS WAS POSTED BEFORE NEW JAR, TESTING NOW
I went ahead and made a testing server for this, as I was truely stumped and I came up upon something very interesting. With NoLagg Alone, using a 2500 tick examination, #ChunkProvider only uses 208ms the entire time. However, once I add NFT and have a 1,000tick examination, #ChunkProvider uses 781ms during the entire examination.
I also noticed a severe memory leak upon adding NFT. Before adding NFT, the server runs at around 575mb, after adding it, it jumps to 1.1GB and gradually increases from there. With NFT without NoLagg, it starts at 575mb again, then within 15 seconds after server is done loading plugins, climbs rapidly to 1.1GB once more.
Just to make sure it wasn't any other plugin that could possibly be conflictoing, I put NFT in the plugins folder completely alone. Right as plugins finished loading, the RAM consumption was at 402MB, not even 6 seconds later, 1.2GB. I would like to say that there is a massive memory leak with this plugin.
NoLagg = No Memory Leak
NoLagg + NFT = Memory Leak
NFT = Memory Leak
- Issue seems to be NFT
NoLagg = #ChunkProvider remaining minimal
NoLagg + NFT = #ChunkProvider registering to be high
NFT = N/A (Without NoLagg, can not run /nolagg examine)
- Possible confliction between NoLagg and NFT
Versions:
CB: 1.4.7-R0.1
NFT: 0.11
Hopefully this helps with whatever you need xD
@xclucky
Apparently this was my fault :( Give the latest build a go and see if that fixes it.