[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

    CyborgOne

    My server is running Craftbukkit version git-Bukkit-0.0.0-409-gcb2bced (MC: 1.2_01)
    But now it works fine. Don't know which other plugin let drops did so funny things, but now its ok. wasn't the fault of this plugin :)

    thx for your very good work!
     
  3. Offline

    Olat

    This ^^
     
  4. Offline

    Mircast

     
  5. Offline

    TOAST7312

    My console is telling me to tell you that your treehugger is using STUPIDLY LONG CONSTRUCTORS!

    Somehow, I find this hilarious.
     
  6. Offline

    mrboese

    Another great plugin (like "Stackable"), which won't work anymore [​IMG]
     
  7. Offline

    BeerBaron

    nag him xD na just hope u will update it ;)
     
  8. Offline

    RugRats

    Update please.
     
  9. Offline

    Grrbrr404

    Update please :)
     
  10. Offline

    dragonking

    update for 1.3 please :)
     
  11. Offline

    CyborgOne

    +1 ;)

    by the way...

    [WARNING] Using the stupidly long constructor com.bukkit.MadMichi.TreeHugger.TreeHugger(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is no longer recommended. Go nag the plugin author of TreeHugger to remove it! (Nothing is broken, we just like to keep code clean.)
    --- merged: Feb 24, 2011 8:55 AM ---
    i've found just another error in my log:
    Code:
    [SEVERE] Could not pass event LEAVES_DECAY to TreeHugger
    java.lang.NoSuchMethodError: org.bukkit.World.dropItemNaturally(Lorg/bukkit/Location;Lorg/bukkit/inventory/ItemStack;)Lorg/bukkit/entity/ItemDrop;
    	at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.dropTreeTopStart(TreeHuggerBlockListener.java:54)
    	at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.onLeavesDecay(TreeHuggerBlockListener.java:113)
    	at org.bukkit.plugin.java.JavaPluginLoader$26.execute(JavaPluginLoader.java:257)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
    	at net.minecraft.server.BlockLeaves.g(BlockLeaves.java:131)
    	at net.minecraft.server.BlockLeaves.a(BlockLeaves.java:120)
    	at net.minecraft.server.World.h(World.java:1503)
    	at net.minecraft.server.World.g(World.java:1434)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:329)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
    
     
  12. Offline

    Nieksas

    such a good plugin , update please
     
  13. Offline

    Wulfspider

    I'm getting the same could not pass event LEAVES_DECAY to TreeHugger
    java.lang.NoSuchMethodError as the people said in the above posts. I removed it as either it or Stats 0.53 was causing a few other plugins to break.
     
  14. Offline

    Ola

    Love this plugin, please update!!! "/
     
  15. Offline

    TOAST7312

    This would be the error I receive when I cut down a tree.

    Clearly unacceptable.

    Also, your constructors are still stupidly long, to add insult to injury.. ;P
     
  16. Offline

    Mircast

    I don't know if he's planning to update it or not, but I suggest disabling it if you don't want leaves to stay airborne. That and error's in the console.......
     
  17. Offline

    MadMichi

    I am updating definitely... hope to get it done when i come home from work... please be patient for a couple of hours longer ;)
     
    DigidragonZX, pwncake and Ola like this.
  18. Offline

    TOAST7312

    You are a scholar and a saint. No longer shall the masses be fetid and wood-less! No longer shall our fists be stained with needlessly shed blood! No longer will our consoles be flooded with stupidly long constructors!

    Seriously, those constructors are really just STUPIDLY long. They're like coding's D student.
     
  19. Offline

    anon

    yay great. I was really afraid this was abandoned. You made my day happy :D
     
  20. Offline

    flerndip

    That's good news. My players adore TreeHugger. I hope it is updated soon.
     
  21. Offline

    oOunrealOo

    it doesent work with 1.3 and can u make it so the tree will drop even if its leaves are touching somthing its rather annoying u have to detach the leaves aswell?
     
  22. Offline

    BeerBaron

    yeah thats true would be great if you could do that
     
  23. Offline

    MadMichi

    Finally!
    0.7c with support for MC 1.3
    But be aware... mostly untested quickfix!
    Please report bugs... and now...
    Have fun! ^^
    --- merged: Feb 24, 2011 9:19 PM ---
    On the todo list ;)
     
    BeerBaron likes this.
  24. Offline

    BeerBaron

    i have craftbukkit build #432
    and i get this error
    Code:
    ... 8 more
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:52)
    at java.util.jar.JarFile.(JarFile.java:99)
    at java.util.jar.JarFile.(JarFile.java:135)
    at java.util.zip.ZipFile.(ZipFile.java:114)
    at java.util.zip.ZipFile.open(Native Method)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:55)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:65)
    org.bukkit.plugin.InvalidPluginException
    2011-02-24 22:24:20 [SEVERE] Could not load plugins/TreeHugger.jar in plugins: null 
     
  25. Offline

    epsolon77

    I have b432 as well and it's not initially giving me an error. Is this happening durring a tree event or on load?
     
  26. Offline

    BeerBaron

    it didn't create a treehugger.properties files for me so i made one on my own now it give me this error
    Code:
    2011-02-24 22:32:50 [INFO] TreeHugger is enabled!
    2011-02-24 22:32:50 [INFO] Errors in TreeHugger properties file - DEFALUTS ARE USED!
    2011-02-24 22:32:50 [INFO] Not-a-number-error in TreeHugger properties file in line: dropping-saplings
    2011-02-24 22:32:50 [INFO] Not-a-number-error in TreeHugger properties file in line: dropping-leaves
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: dropping-golden-apples
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: dropping-apples
    2011-02-24 22:32:50 [INFO] Not-an-item-string-error in TreeHugger properties file in line: items-to-harvest
    2011-02-24 22:32:50 [INFO] Not-an-item-string-error in TreeHugger properties file in line: items-to-harvest
    2011-02-24 22:32:50 [INFO] Not-an-item-string-error in TreeHugger properties file in line: items-to-harvest
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: player-destroys-faster
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: faster-decay
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: leaves-decay
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: destroy-wood
    2011-02-24 22:32:50 [INFO] Error in TreeHugger properties file in line: destroy-all 
    i used you'r properties
    Code:
    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 strint, ...
    # 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.
    dunno what happened but after the third restart it created a properties file and its working fine!
     
  27. Offline

    epsolon77

    you need to actually set the values. aka
    Code:
    destroy-all=true|false
    
    should be
    Code:
    destroy-all=true
    
    Here is a known working TreeHugger.properties
    Code:
    #This is a comment. All lines with a leading # are ignored.
    destroy-all=true
    destroy-wood=true
    leaves-decay=true
    faster-decay=false
    player-destroys-faster=false
    items-to-harvest=
    dropping-apples=.5
    dropping-golden-apples=0
    dropping-leaves=0
    dropping-saplings=10
    #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.
     
  28. Offline

    MadMichi

    I made some small updates, please redownload.

    @BeerBaron: please delete the treehugger.properties and run the server once. It will create a new properties file wich you then could alter to your needs.
    Lines like destroy-all=true|false mean the following:

    destroy-all=true

    or

    destroy-all=false

    ;)

    Ha, you where slightly faster epsolon [​IMG]

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

    BeerBaron

    i deleted the old files but it didn't create me a new one

    but like i sad after a few restarts it did :D so thanks MadMichi
     
  30. Offline

    epsolon77

    Hey you made this work with 1.3, least I can do is beat you to the punch fixing issues! [​IMG]
     
  31. Offline

    oOunrealOo

    also i would like to say this is my favorite pluggin there far to many for creative and i host servival server and this 1 is so easy to configure!
     
  32. Offline

    Punchin

    Code:
            at com.bukkit.MadMichi.TreeHugger.TreeHuggerBlockListener.dropTreeTopWoo
    d(TreeHuggerBlockListener.java:94)
    Getting this spamming my console (like thousands of times per second) while near a forest fire.

    @TOAST7312, that error is a bukkit error. Update to 441 and it'll go away.
     

Share This Page