[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

    MadMichi

    Thank you, i hope your server runs well even if it spams errors ;)
     
  3. Offline

    rbos

    Saplings do not appear to drop enough. About 1 sapling per two (large) trees.
     
  4. Offline

    HaloInverse

    I agree with rbos, sort of. It would be nice to be able to adjust the sapling drop rate, the same way one can currently adjust the drop rate of apples/goldapples/leaf blocks.
     
  5. Offline

    Chekkaa

    Is it possible for you to make the list of dropped items configurable? Back when I had LeafDropper, I made trees occasionally drop nether materials and sponges, as they are not otherwise obtainable.
     
  6. Offline

    MadMichi

    I will add this to the next release.

    What do you think of this suggestion: adding one entry in the properties file for sapelings so that everything a normal tree would deliver is covered and the realism fan is happy. And for the advanced user the opportunity to add every drop he likes.
    --- merged: Jan 25, 2011 8:25 AM ---
    New version 0.6!
    Please test and report bugs you find :D
    --- merged: Jan 25, 2011 4:14 PM ---
    I found out what the problem is!
    I had that error message a couple of times too and wasn't able to reproduce it. But now i know my recursive method crashes when too many leafblocks are clustered together.
    Fixing this asap!

    [EDIT]
    Fixed in v0.6a! [​IMG]
     
  7. Offline

    mattekure

    downloaded and installed 0.6c, but when server starts up, it says 0.6a is enabled
     
  8. Offline

    MadMichi

    D'oh! Forgot to update the plugin.yml... fixed ;)
    Thanks for reporting back!
     
  9. GREAT update. You have far surpassed the old LeafDropper functionality. Also, I totally missed the fact that you made trees explode when they lose connection to the ground (as an option) - this is just WONDERFUL. People often don't even clean up all wood blocks, so exploding leaves don't help - this makes harvesting wood less of a chore and FINALLY no floating treetops EVER. I love this plugin! ^^

    P.S. One last thing. Can you move the config file to /plugins/TreeHugger/? =)
     
  10. Offline

    MadMichi

    Hi Lim-Dul, i added another .zip for you. If the other users like it too, i will stick to it ;)
    Greetz Mad
     
  11. Thanks!
    However, it's not just my preference. If you look at most standards-compliant plugins you'll notice that they all store their configs like that. It's a Bukkit guideline to make them do it this way, I think.
     
  12. Offline

    Bronski

    The options above confused me a touch, but I got the exploding trees thing going with these options:

    However, it seems like they don't explode when I just remove the bottom block of wood that connects the tree to the ground. I have to remove a second block in order to make the tree fall and I'm not sure if I'm doing something wrong or that's the intent. The tree in question wasn't connected to any other trees or anything, just the trunk connection to the ground.
     
  13. Offline

    HiroEX

    Any ideas why im getting this error? Jan 27, 2011 1:01:44 AM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event LEAVES_DECAY to TreeHugger
    java.lang.NoSuchMethodError: org.bukkit.block.Block.getLocation()Lorg/bukkit/Location;
    at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.dropItems(TreeHuggerBlockListener.java:170)
    at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.dropTreeTopStart(TreeHuggerBlockListener.java:58)
    at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.onLeavesDecay(TreeHuggerBlockListener.java:113)
    at org.bukkit.plugin.java.JavaPluginLoader.callEvent(JavaPluginLoader.java:182)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:199)
    at net.minecraft.server.BlockLeaves.g(BlockLeaves.java:124)
    at net.minecraft.server.BlockLeaves.a(BlockLeaves.java:114)
    at net.minecraft.server.World.g(SourceFile:1556)
    at net.minecraft.server.World.f(SourceFile:1482)
    at net.minecraft.server.WorldServer.f(WorldServer.java:33)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:256)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:197)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
     
  14. Offline

    MadMichi

    This is the expected behaviour of the plugin. But i will change that in the next version, so that the tree explodes when the first log is removed.
    I don't know yet, but i will do some testing if i can reproduce this error. Can you tell me some more details? What are your configs, what craftbukkit version, etc.
    Tanks in advance
     
  15. Offline

    HiroEX

    You know, i downloaded bukkit again and it seems to be working, sorry bout that!
     
  16. Offline

    den

    Any chance this can be updated to work with fire? If fire disconnects a tree from the ground it explodes? It would make using fire to clear land so much easier.
     
  17. Offline

    MadMichi

    NP [​IMG]
    I will start some test on this when i find the time... Thanks for the suggestion.
     
  18. Offline

    benthemeek

    I too would like a way to clean up after a forest fire. Its an eye sore and I just want the burning logs to fall when not connected to any other type brick. Anyway to include this fucntionality in the plugin? I have two or 3 forest fires to clean up on my server and not looking forward to to all the climbing and chopping :p
     
  19. Offline

    OptiDash

    I'm a little confused on what 'destroy-all=true|false' does.
    Doesn't 'leaves-decay=true|false' do the same thing?
     
  20. No. Leaves decay disables Notch's leaf decay system which might be useful if you want to build something from leaf blocks. Destroy all makes trees explode, so yeah, you won't get decay off them either but you still would if you were to re-place the blocks.
     
  21. Offline

    Planitia

    There's a plugin called 'Gimmie my Blocks' That does this is broken with a golden tool :D
     
  22. Offline

    comradesasha

    I have a very dense forest with many trees' leaves touching. I isolated a block of it: cut all leaf connections to the rest of the forest). Then I cut all the tree bottoms but the entire log/leaf mess block didn't explode. Could you change your algorithm so that it would explode in such a case?
     
  23. Offline

    Planitia

    Cuboid :D
     
  24. Offline

    comradesasha

    Doesn't help if I want my users to be able to deforest an Amazon-type forest unless I give them all Cuboid/world edit permissions.
     
  25. Offline

    Planitia

    You can do a huge replace wood/leaved with air.
     
  26. Offline

    MadMichi

    It should do exactly that. But as my algorithm saves all the blocks to destroy in a list class of java that can't handle so many i had to set a maximum. I will try to raise the maximum in one of the next releases by using another class or so but till then you will have to make smaller "packages" of tree clusters...
    I think a cluster of five trees with one big tree or ten normal trees should be no problem yet... please make a couple of test lumbers ;)
     
  27. Offline

    SneakyTax

    Just to confirm this; after running this mod with defaults the trees that are NOT connected with the ground still seem to linger around. If I hit thier leaves with something... *poof* then it drops.

    I originally thought the point of this was to KILL the "floating" trees (and to have trees with drops like apples/etc).

    I have not seen any floating leaf-patches, so that seems to have been fixed (due to this mod). :)

    Perhaps just needs an option to nuke the trees that are ALREADY floating (not the one I just made by cutting the base)?
     
  28. Offline

    MadMichi

    If a tree has no connection to the ground (or other blocks) and automatic leaf decay is activated the tree will explode as soon as one leaf block decays. So basically it does bring down already floating trees. If the leaves for some reason do not decay, there is no way to check that without heavy server lag (checking all blocks sorrounding the player is too cpu-intensive).
    I tryed around a bit but as fire already means heavy stress to the server and my algorithm would be called every time a log block is destroyed i'm afraid this would lag the server to near death. Additionaly as stated above, checking for already burning log blocks would be very hardware-intesive... :(
     
  29. Offline

    r4NGe

    Is this possible.

    leaf decay is maintained unless golden axe is used. If golden axe is used, tree explodes.
     
  30. Offline

    MadMichi

    This is not possible yet. But i will keep this in mind and eventually implement in one of the next releases...
     
  31. Offline

    SneakyTax

    Okay - makes sense, I will keep an eye out for "hanging" trees. I do have the leave decay on, so if they are disconnected they should begin to poof. :)
     

Share This Page