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/
@xclucky
Given how they happen at the same time I would bet that it's NoFloatingTrees somehow causing it. Which version are you using ?
@wide_load
I'm actually not sure... I'm asking the developer of NoLagg now. Still waiting on a response. I wouldn't doubt it has something to do with NoLagg's chunk loader though... That thing has always caused me issues. Also, I've got a terrible memory leak (consumes 4gb RAM in under 2 hours (I restarted server about 10 minutes ago, it started at 783mb RAM, it's already at 2.3GB)... Do you know a fast way to diagnose what plugin is causing it?
@xclucky
What is #ChunkProvider ? It could be that something is loading loads of chunks.
@wide_load
I'm going to ask the dev of NoLagg about it too, as #ChunkProvider seems to be spiking at the same time, perhaps they're related... I'll continue to refresh this page as I do every 12 or so hours xD I have about 50 watched pages open right now lol
@xclucky
Not really, patience :P
So any updates on my post from two days ago?
@wide_load
Here you are:
Screenshot: http://wocl.net/errors/ServerLag/nft2.png
NoLagg Examination File: http://wocl.net/errors/ServerLag/NoLaggExam2.zip
I would also like to note, I did this examination immediately after a server restart (not reload) while there were 0 players online and the decay quene size was 0. Also, Population Density was doing a region scan for every possible resource block within a 400x400 block area for approx 60% (or so I believe, it displayed a region examination of the resources in the area about 60% the way through the nolagg exmaine) of that time... Here is my config:
@Z645
Try it and find out. (spoiler, yes)
Will this work in 1.4.6 and 1.4.7?
@xclucky
Hm odd, could you try /nftdebug and tell me your queue size ? Also could you try disabling the LogBlock integration (only if you have LogBlock obviously) it would be down to database slowness or something like that.
@wide_load
Screenshot: http://wocl.net/errors/ServerLag/nft.png
NoLagg Examination File: http://wocl.net/errors/ServerLag/NoLaggExam.zip
I should probably check my links before posting them xD
EDITED AFTER POSTING - 1/24/2012 22:51 GMT
@xclucky
"Object not found" :/
And I can add that yes :D
This plugin is THE MOST resource intensive plugin on my server, and I have 60 plugins, why is this? Also, could you please add a percentage chance of replanting saplings upon tree removal?
http://f.wocl.net/ServerLag/nft.png
@SatoAV
Sorry for the delay, the ConcurrentModificationException is caused by plugins modifying the world/entities from a thread other than the main one. NoFloatingTrees does not do that so you will have to work out which one is causing the problem and contact that developer.,
@wide_load
It happens every 3-4 seconds, then after a couple of hours the server just crashes with:
http://pastebin.com/JcjGSg2b
And then just Read time out. RToolkit can't handle the crash, so I need to restart the server manually.
I had to remove this plugin for now, as server stability is more important. I hope this will get fixed somehow, 'cause the plugin is too good :3
@SatoAV
How often does that come up :/ I've never seen it on my server running the same version. As for the tick rate I doubt it would be this although if you provide some timing data I can look into it.
I get this error on CB 1.4.5-R1.0:
[NoFloatingTrees] Task #9 for NoFloatingTrees v0.11 generated an exception
java.lang.NullPointerException
at uk.co.jacekk.bukkit.NoFloatingTrees.storage.DecayQueue.getDecayCandidates(DecayQueue.java:106)
at uk.co.jacekk.bukkit.NoFloatingTrees.LogDecayTask.run(LogDecayTask.java:25)
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:53)
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:529)
at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:222)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:493)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:426)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)
My server also drops to very low TPS, which can't be good.
The server takes 16 Gb RAM and a very hi-end CPU.
Any ideas? The plugins is great, I don't want to shut if off :'(
@Luzitano
Try it.
@LEOcab
1) Shouldn't do, depends on your hardware and if your players cut down 1000 trees per second :P
2) Only new trees will be handled since it works by check when a player breaks a block and saving the log locations for the tree for later. WorldEdit has a tool for removing floating trees though so I would try that, /tool deltree is the command.
I have two questions: 1) Does this plugin cause lag? I know it probably does a lot of calculations in open chunks so I understand a little overhead is unavoidable. 2) Does it handle "old" trees as well, or just newly chopped trees? I have a lot of floating trees in my world. ;_;
Thanks! :)
Works on 1.4.6? :) really need this