[FIX/MECH] NoFloatingTrees v0.4.1 - Automatically Remove Floating Leaves [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Jacek, Aug 22, 2011.

  1. Offline

    Jacek

    NoFloatingTrees - Automatically Remove Floating Leaves
    Version: 0.4.1

    This is now here: http://dev.bukkit.org/server-mods/nofloatingtrees/

    Description

    This plugin logs the position of any block that a player breaks that looks a bit like a tree. Every 30 minutes each entry in this list of positions is checked more thoroughly to make sure it is a tree and that is it not connected to the ground. When it is found that there are leaves with no logs connecting them to the ground, all of the logs of that tree will be removed allowing the leaves to decay naturally.

    To prevent this being abused by people that have looked at the tree checking code the area must contain at least 15% leaves (most trees contain 20% + and most log houses contain ~1%). As well as this the area must not contain any glass, planks, cobble or half blocks.

    If you have the LogBlock plugin installed, any blocks that this removed will be logged as the user "NoFloatingTrees".


    Download

    http://bukkit.jacekk.co.uk/NoFloatingTrees/NoFloatingTrees.jar


    Chat Commands

    /nftpurge - Run the removal task manually, it will still run at the next scheduled time.


    Permissions

    nofloatingtrees.command.nftpurge - Allows the use of the /nftpurge command, this defaults to ops only.


    Known Bugs
    • Sometimes weirdly shaped trees will not be removed fully
    • If someone happens to plant a tree in the same spot and then not cut that down fully within the 30 minutes, the same position will be checked twice.
    • People that start cutting a tree as the removal task starts will be unlucky.
    Changelog

    Version 0.4.1
    • Fixed some issued with the command.
    • Added a message so you know it actually ran.
    Version 0.4
    • Now works for trees that are blown up too.
    Version 0.3.1
    • Fixed a spelling mistake (yes really!).
    Version 0.3
    • Added LogBlock integration.
    Version 0.2.2
    • A tree will now only be removed if the surrounding area does not contain any glass, planks, cobble or half blocks.
    Version 0.2.1
    • Improved the "is that a tree" check and the check done on each block that is removed.
    • The list of trees is now check every 30 minutes as promised not the 5 I used while debugging.
    • The "remove trees" message is no longer logged to the console (that was something left over from testing, total pro)
    Version 0.2
    • Fixed an NPE when a tree spanned into chunks that were not loaded.
    • Added a command to remove trees.
    • Prevented the list being processed if it is already being processed.
    Version 0.1
    • Initial release.
     
    Deathfromace likes this.
  2. Offline

    MonsieurApple

    Looks good, approved.
     
  3. Offline

    Jacek

    Why thanks you :D
     
  4. Offline

    Deathfromace

    Looks like a better method then just giving lazy players all the wood from the tree by using an auto cut plugin. Thanks
     
  5. Offline

    Jacek

    Exactly why I made this :D

    I get really pickey over how my worlds look and was getting bored of removing leaves, even with world edit it takes ages !

    I am in the process of making some pretty significant improvements, so make sure you update in an hour or so if you are using this already.

    Updated, log houses with trees planred next to and on top of them should be safe.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  6. Offline

    Deathfromace

    Good thing I have not updated yet as I was wondering what would happen to a floating tree house...
     
  7. Offline

    Vettexl

    The plugin runs okay, but it.. doesn't do anything.. even when I try /nftpurge.

    Running Bukkit Build 1060 for Minecraft 1.7.3
     
  8. Offline

    Jacek

    A floating tree house should be safe due to the percentage of leaves. It would be nice if there were a way to trigger an block break event so that I could have the logs look as if they were broken by a player meaning any mistakes could be undone with BigBrother.

    I have a couple more planned improvements to the tree checking, one of the uses on my server built a log house and then covered it with trees, looks very cool but there was a bit of an accident (this was pre 0.2.1). I figured I could check the area for non-natural blocks too, most log houses will have planks in or glass for windows etc.

    Not really sure what to say about that, do you get any errors ? It most likely means that the block you chop is not initially considered as part of a tree trunk, it needs to have dirt or log below it and the two blocks above have to be log, also the highest block has to be leaves.
     
  9. Offline

    Vettexl

    I get no errors,the plugin runs fine it just doesn't do anything, and the description you specified about the trees matches the test I was doing.
     
  10. Offline

    Jacek

    Have you tried 0.2.2 ? I have no idea why you would see nothing at all :s
     
  11. Offline

    Vettexl

    I have a fresh install of craftbukkit so I'll try that and edit this post with my results :)

    EDIT: Got the error log this time http://pastebin.com/JwGt8Thg
     
  12. Offline

    Jacek

    It's a chat command, not a console command.
     
  13. Offline

    Vettexl

    When I use it in chat nothing happens still. =/

    EDIT: I posted those errors just in case it could help you :)
     
  14. Offline

    Jacek

    Well I should have caught that exception, so it does :)

    I'll post a debugging version of this tomorrow that spams the console, when I do , you can post that and it will help with this issue.
     
  15. Offline

    Vettexl

    Sounds good, thanks!
     
  16. Offline

    Deathfromace

    Works fine for me and new update sounds great and should help not making tree houses of any kind disappear.
     
  17. Offline

    Trenix

    Doesn't work for me either and here's my error.
    Code:
    >nftpurge
    23:24:44 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'nftp
    urge' in plugin NoFloatingTrees v0.2.2
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    9)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:3
    44)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:489)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:468)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.Coloured
    ConsoleSender cannot be cast to org.bukkit.entity.Player
            at uk.co.jacekk.bukkit.NoFloatingTrees.onCommand(NoFloatingTrees.java:57
    )
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 6 more
    >
    
     
  18. Offline

    Jacek

    Are you using the command form the console ?

    0.3 will have LogBlock integration so things can be rolled back too :D
     
  19. Offline

    xMv750x

    what if i make a wooden house thats formed like a tree and breaks some of the blocks will the house be removed then? x)
     
  20. Offline

    Jacek

    Short answer: Maybe.

    Long answer: Not if it contains less than 15% leaves, or if it contains any glass, planks, cobble or half blocks.

    Can you try http://bukkit.jacekk.co.uk/NoFloatingTrees/NoFloatingTrees_debug.jar and post the output when breaking a block and then running the command.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  21. Offline

    APhilosopher

    the /nftpurge command does not work for me, heres the error generated
    Code:
    [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'nftpurge' in plugin NoFloatingTrees v0.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Chunk.isLoaded()Z
        at uk.co.jacekk.bukkit.NoFloatingTreesRemoveAllTask.run(NoFloatingTreesRemoveAllTask.java:108)
        at uk.co.jacekk.bukkit.NoFloatingTrees.onCommand(NoFloatingTrees.java:73)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    i will keep an eye on the test trees to find out if it still functions every half hour

    btw, i noticed a spelling error, when a regular player types /nftpurge they get the messege

    you do not ave permission to use this command.... ---notice the missing H from have :D :D
     
  22. Offline

    Jacek

    Line 108 is

    Code:
    if (chunk.isLoaded() == false){
    Which is a little confusing ! Are using use the latest RB ?

    I will fix that typo though, a little embarrassing ;)
     
  23. Offline

    APhilosopher

    hey no worries, it gave me a laugh, :D

    im guessing RB stands for recomended build? im using

    Craftbukkit version git-Bukkit-0.0.0-945-g73697a4-b1000jnks (MC: 1.7.3)

    at the moment


    also, i wanted to ask, is there a way this plugin could include the trees which are left floating due to creeper explosions? my spawn area gets alot of those,
     
  24. Offline

    Jacek

    Can you try with the supported version , #1060 ?

    And yeah I should be able to add creeper damage pretty easily, I will do that now in fact.
     
  25. Offline

    Neobenedict

    Compliled version suprtesses comments and otehr things so that may not be line 108.
     
  26. Offline

    Jacek

    Say that again in English.
     
  27. Offline

    Neobenedict

    Sorry, what i meant is if you're getting 108 off your source code, you've probably got comments and stuff in there. When you compile it, the comments and spare lines (I think) get removed, so the line numbers change. I think.
     
  28. Offline

    APhilosopher

    i updated my bukkits to the shiny new version

    still no success with the command /nftpurge

    i wish i could get you a copy of the potential error report from the logs this time but i dun wanna shut the server down again, lots of people online this time of day alrdy made em tolerate 4 shutdowns xD sry. once it quiets down ill go check the logs and see if it error reports during the command
     
  29. Offline

    Jacek

    They don't ;) If they did, what be the point of the line number.

    Hmm, okay, well I will wait on the error log them. No idea what could cause that and give no error :?
     
  30. Offline

    APhilosopher

    ok i said screw it and shut it down to get the log real fast, told em i didnt do it (lie) :D :D :D

    however checking the logs i am now not getting any error xD i type /nftpurge in game and i get no msg at all and the tester trees remain i make new tester trees to be sure with a regular player and /nftpurge stil does nothing,

    i even woulda expected a "unknowncommand" msg like i usualy get if i type jibberish but when i type /nftpurge i get nothin,

    still havnt tried just sittin around a half hr and watching , done so many restarts i would expect it probly doesn keep track of floating trees made before a restart? idk,
     

Share This Page