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/
hi, when i break a snow tree it doesnt work, i type /nft queue and say 0 help please, thanks bro
Anyone using build #15 should update. #15 includes a new profiler (times each method and reports it back to my server to help with debugging performance) that is set to run every 3 seconds instead of every hour as it should. This was done for testing and should not have been pushed to GitHub.
tl;dr Get #16 or above.
@dragondeatth
As far as the game is concerned there is no difference between a tree that grew and one that was put together by a player. There are a number of checks to prevent structures being removed but if any do get removed I'd need to see the shape of them so I can tweak the checks.
@GioboiMC
Yeah, the solution would be for the developer to only activate this for trees made by the server itself, and not player-made. I've seen a lot of other plugins doing this. Wide_load, can you please add this feature? :D
@GioboiMC
If you do please show me the shape of what it deleted so I can fix the tree check :P
Anyone have problems with this deleting blocks used as decoration?
@Chaznuts
If they used a BlockBreakEvent instead of a FakeBlockBreakEvent then it would workl. I don't want to add special code for a specific plugin, that becomes very hard to maintain very quickly.
@wide_load
I requested they add a BlockBreak event or make it so it doesn't leave floating logs, and they responded with this:
"gmcferrin commented:
Tree Feller does, in fact, fire a FakeBlockBreak and FakeBlockDamage event for every block, or at least, it should be."
Not sure whose plugin is not working (or if they're just not playing nicely together), but I wanted to let you know. Any response to that? Thanks!
@wide_load
Ah I see. Thanks! I will contact them to see if they will update. :)
@Chaznuts
It would be up to mcmmo to fix that, if the call the block break event for each bock that gets removed then it would be detected by nft.
@wide_load
Hello again! Personally, I am not seeing any issues with this plugin. It all seems to be working correctly, yet I haven't gone into extensive testing, just a little bit.
Anyways, I have a request. Is there any possibility you could make this plugin compatible with mcMMO's tree feller ability? Currently, it is very common to see tree feller be used on a jungle trees, but it tends to leave the little "branches" off to the sides and only takes down the 2x2 trunk of the tree. Being so high up and now floating, players tend to not put in the effort of removing those branches.
If there is a way for NFT to listen and log when players use that ability so those remaining few logs would decay, it would be great (I believe big oak trees chop down fine, it's just big jungle trees). If not, no worries and I will contact the authors of mcMMO again to see if they could fix the ability not removing all of the wood. Thanks for your hard work and keep it up!
@x_clucky
If the server is stopped as a block decays it might not work as expected, although I have never seen that during testing. There is a feature to store the list of blocks waiting to be removed when the server stops.
@wide_load
I found a missing tab :( Take your time, I'll just use the crappy one included in griefprevention until you get yours working better. Also, do the tree demolitions last through restarts? Cuz i found a half broken tree, literally, half of the blocks in the tree were broken, the other half weren't... It was bizzare.
@x_clucky
It's coming, I have a lot of other stuff to do atm :(
@wide_load
Any progress on removing oddly shaped floaters?
@x_clucky
If a new tree was grown in the same place then it would not remove the blocks from the previous tree from the decay queue. That could explain what you are seeing, I think it would be pretty easy to have them remove so it seems fixable :P
I had a weird bug where NFT just randomly decided to clear one players entire farm, all except for the bottom block... What's going on here? I checked the bottom block, and it says that a sapling was placed there. Therefore, I know for a fact that the logs were not placed there. I took a few screenshots to paint a better picture:
http://imgur.com/FCEy1C5
http://imgur.com/lpd2CSx
@Desertive
It's not all of the trees, it seems to depend on which log is the last to decay. I also found that they will start to decay if the chunk is unloaded and then loaded again. I will see how hard it would be to provide the physics update but this looks a bit like a quirk with the way the game works than anything.
Yep, they start to decay after someone has hitted at least one block of leaves away.. Is there any solution for this porblem? :(
@Desertive
It looks like they sometimes they need a physics update before they start decaying, try hitting one and see if the rest vanish.