[INACTIVE][MECH] TreeHugger v0.7c - fit trees to your needs

Discussion in 'Inactive/Unsupported Plugins' started by MadMichi, Jan 18, 2011.

  1. Offline

    MadMichi

    [​IMG]TreeHugger v0.7c


    Do you find it annoying when you chop wood and all these leaves are hanging in mid-air?
    And why don't trees drop apples or leaf blocks?
    If you ever asked one of these questions TreeHugger is the plugin for your server!

    [​IMG]

    What is TreeHugger plugin?
    For now TreeHugger has following features:
    1. It can disable the automatic leaf-decay.
    2. It can spawn apples, golden apples, saplings and/or leave blocks where ever leaves are destroyed.
    3. It can slightly increase the amount of decaying leaves.
    4. It can slightly increase the amount of leaves destroyed by the player at once.
    5. It can drop the treetop. Chop all the wood out of a tree top and all clustered leaves (not connected to the ground or other kinds of blocks) will be destroyed. Now a whole tree can be dropped with all wood in it by destroying the trees connection to the ground.
    6. Harvest items only when user defined tools are in the hand of the player.
    7. Any type of block or item can be dropped if leaves are destroyed.

    More to come... stay tuned for updates.

    How to install TreeHugger?
    Download the TreeHugger.jar and put it into your plugins folder. After the first launch of the server, a properties file named TreeHugger.properties will be added to the folder "\plugins\TreeHugger\". Now you can configure as you wish and restart the server.

    If you like you can also move the properties file to the bukkit root folder an delete the TreeHugger folder in the plugins folder.

    Please delete old TreeHugger.properties if you install a newer version.

    What is in the TreeHugger.properties file?
    The file consists of:
    destroy-all=true|false
    # Activate destruction of all clustered floating leaves. Leaves connected to wood / dirt / etc. won't be harmed.
    destroy-wood=true|false
    # Activate destruction of whole tree with wood if connection to the ground is lost.
    leaves-decay=true|false
    # Here you can activate/deactivate the new old automatic decay of leaves.
    faster-decay=true|false
    # Leaves decay slightly faster but drop less items. If leaves-decay ist false, faster-decay is ignored.
    player-destroys-faster=true|false
    # Player destroys more leafe blocks at once but drops less items.
    items-to-harvest=item id|item string, item id|item string, ...
    # Define tools that make harvesting the items possible. You can use item ids and strings separated by comma
    dropping-apples=[0.00-100.00]
    # 0% to 100% chance of apples dropping if leaves are destroyed.
    dropping-golden-apples=[0.00-100.00]
    dropping-leaves=[0.00-100.00]
    dropping-saplings=[0.00-100.00]
    # do i really have to tell you? :p
    #Append your custom drops as followed (without the #). Examples:
    #dropping-custom=dirt,1.5
    #dropping-custom=46,20
    #This would drop dirt with a chance of 1.5 percent and tnt (id 46) with a chance of 20 percent.

    Changelog
    v0.1 Initial release.
    v0.2 Added validation for the properties file.
    Also the percent values take now float with two decimal places.
    v0.3 Two new settings in the properties file: faster-decay & player-destroys-faster.
    Fixed Bug where a percent value of 0 rewrote the properties file.
    Fixed Bug where only one of the desired items coud drop from one leafe block at a time.
    v0.4 New setting in properties file. DropTreeTop functionality.
    v0.5 Items drop correctly now if the tree top explodes.
    v0.6 New settings in properties file. Drop tree with all the wood in it. Harvest only with user defined tool in hand. Drop any kind of block or item from leaf blocks.
    v0.6a Fixed a bug where too many clustered blocks crashed the algorithm and spammed the server console with error messages.
    v0.6b Fixed a bug where no selected harvest tools lead to no item drops.
    v0.6c Fixex a bug where trees with snow on it wouldn't explode.
    v0.7 Slightly more trees do drop down at once. Properties file can now be in bukkit root directory or in "\plugins\TreeHugger" directory. Trees now drop from the first chopped log block upwards. Correct log blocks are now dropped (birch, dark). Thanks Nijikokun!!
    v0.7a Had to temporarily deactivate the correct drop of wood colors since errors with new craftbukkit release.
    v0.7b Wood colors reactivated.
    v0.7c Quickfix for MC1.3. Reduced tree drop count, hopefully less console errors now.


    Todo
    - rewrite the drop treetop algorithm without recursion so that more clustered trees can be dropped at once
    - make all dyes droppable
    - try to make TreeHugger work with Permissions
    - option for treedestruction even if connected to other blocks
    - option to disable fast grow a tree with bonemeal

    Known Bugs
    - console spams errors if many blocks are affected by TreeHugger functions - will be fixed when the first point from the todo list is done


    Please leave comments / requests / bugs / hatemail / etc.

    Special thanks to:
    Nijikokun, MarkusNemesis, QuantumAI and DjDCH and all the programmers who are dispensing their help in the development forum.

    Also big thanks to the Bukkit-Team for their awesome work!

    Very special thanks to:
    [diamond]Affecting_Nelas[diamond]
    for coding the new drop treetop functionality!

    Greetz MadMichi
     
    PoPsou, Ola and chibirubara like this.
  2. Offline

    Masocristy

    Nice!

    How about leaf blocks only drop leaves if you harvest them with a certain tool?
     
  3. Offline

    SeeD419

    This is great. Looks easy to configure. I think CraftBook made trees drop apples before, but it has yet to be ported, so I'll test this out.
     
  4. Offline

    subram

    Nice I hope it works ;)
     
  5. Offline

    KillerKani

    Works great! Good Idea but whats about that: If a player cut the lowest peace of the Tree the hole Tree will drop?

    MFG KillerKani
     
  6. Offline

    MadMichi

    Should be no problem. [​IMG]
    I don't know when i can get to this, but a good idea.

    Hmm... i will have a look...
    BTW i am from germany :)
     
  7. Offline

    KillerKani

    Gut ich auch XD weil englisch ist nicht gerade meine stärke... hast du gerade erst mit java und all dem angefangen?
     
  8. Offline

    MadMichi

    In einem englisch sprachigen Forum könnte man das leider u.U. für unhöflich halten :oops:
    Also weiter in Englisch, Übung macht ja schliesslich den Master ;)

    I learned Java some time ago in my studies of computer science. But plugins and mods i have never made before.

    Back to your first post:
    I am not sure, but i think what you described is not a bug. If you cut all the wood of a tree away, the leaves start decaying. Is that what you meant?
     
  9. Yes! So basically a re-code of LeafDropper! One of my favorite plugins! ^^

    P.S. I haven't been able to test it yet, but if you disable leaf decay, do trees "explode" like in LeafDropper when you remove the last log in a group of leaves (triggering drops) so there are no floating coronas everywhere? If not, consider implementing that. =)
     
  10. Offline

    MadMichi

    No, unfortunately my plugin can't explode the leafe blocks yet. I hope to figure out how that is done in the future.
    Like you may have noticed, the leafe blocks are slowly decaying by default (since beta of minecraft i think). You can turn that off with my plugin.
     
  11. Yup. I know about leaf decay. OK, thanks for the heads up and I hope for some nice development news in future. The configurable drops are nice already. =)
     
  12. Offline

    KillerKani

    No i mean like a real tree in real you cant cut the tree from ground to top.

    #####
    #####
    #####
    ||
    ||
    || <--- If you cut that pice the complete tree fall down 1 block ...

    #####
    #####
    #####
    ||
    || <--- and looks like this ...
     
  13. Offline

    MadMichi

    Now i've got it! Nice idea...
    Maybe even falling to the horizontal... but that would look awkward because i think there is no way to animate the blocks. I can put the them on the ground, no problem, but smooth moving is not possible afaik...
    I will keep that suggestion in mind! [​IMG]
     
  14. Offline

    Zerosan

    Just a quick question, can you set the percentage values below 1?
    Values like 0.01 for example? I think even 1% would be a little to frequent for Golden Apples.
     
  15. Offline

    MadMichi

    Right now, these nubers are integers, not floats. But i can change that in the next release.
     
  16. Offline

    Zerosan

    Would be apreciated :D
     
  17. Offline

    MadMichi

    New version 0.2 [​IMG]
     
  18. Offline

    ktr

    Plugin works great! However, every time I launch my server, TreeHugger overwrites my changes to TreeHugger.properties.

    Using build #89.
     
  19. Offline

    MadMichi

    Thanks for reporting back.
    Should be fixed with 0.3
     
  20. Offline

    MadMichi

    Version 0.5
    Any comments or bugs? [​IMG]
     
  21. YES! You are a God among men! ^^
    Seemingly this is a small plugin but I always valued LeafDropper on my server and so did my players. Exploding trees FTW! ^^

    P.S. Will you make a setting for defining custom drops for trees apart from apples and such? I don't need it but others might! Oh, wait, I do need it since there is no setting for making saplings drop with disabled leaf decay. =)
     
  22. Offline

    Fugensnot

    Question actually, the "Drop Tree Top" functionality does what exactly?

    EDIT: Nevermind xD I found out :3 Thanks for the great mod :D
     
  23. Yeah, for others who were wondering. It's exactly like what I requested and which was found in LeafDropper. The moment the last log in a tree is removed the treetop "explodes" (i.e. vanishes) leaving behind its defined drops. Very good way to battle floating trees and not rely on Notch's buggy and slow leaf decay.
     
  24. Offline

    MadMichi

    Of course, when i find some time the next days. Also i did not forget about the "harvest drops only with item x in hand"-request ;)
    Making a tree fall down when it is chopped may be dangerous for the player though. But i will do some tests...
     
  25. Offline

    Nerdy

    132 craftbukkit build breaks treehugger.

    [​IMG]
     
  26. Offline

    MadMichi

    Thank you for your report, but i just downloaded 132 and it runs fine.
    Have you changed something else than the build of craftbukkit?

    Additionally:
    Can someone please confirm if its running on 132 or not?
     
  27. Offline

    Nerdy

    Nope. Also here is my config file

    Code:
    destroy-all=true
    leaves-decay=false
    faster-decay=false
    player-destroys-faster=false
    dropping-apples=1
    dropping-golden-apples=0.1
    dropping-leaves=0
     
  28. Offline

    Shadus

    Any chance you could make this also drop wood blocks out of the top of the tree if the bottom blocks of the tree are gone? with the larger trees in recent versions i'm seeing players just not harvesting all the wood at the tops of trees (and to be honest, I understand why after cleaning up 20-30 of them...) If the trunk is gone and pieces are more than say 4 up... start dropping them including leaves, apples, wood, everything?
     
  29. Offline

    MadMichi

    Is on my list now [​IMG]
    Tryed your config and still runs.
    Could you copy & paste the entire output from your server?
     
  30. Offline

    Nerdy

    I would love to but I can't stop my server right now to test. But once I do I will be sure to post it here.
     

Share This Page