[MISC/FUN] Appleseed - Plant apple trees! Not your standard apples from leaves plugin!

Discussion in 'Inactive/Unsupported Plugins' started by redsgreens, May 19, 2011.

  1. Offline

    redsgreens

    Appleseed is now on dev.bukkit.org! Go there for the latest versions, a dedicated support forum, and ticket tracking system: http://dev.bukkit.org/server-mods/appleseed/


    Appleseed - Plant trees that drop apples on the ground (or other items!):
    There are other plugins out there that make trees drop apples/items when you break the leaves, but this plugin doesn't do that. With Appleseed, all existing trees are left as-is. To get an apple tree, you must use a hoe to create soil, then right click the soil with an apple in hand. Done correctly(and if you have permission), a sapling will appear in the soil. When the sapling grows(use bonemeal to speed this up), the tree will drop apples on the ground.

    Features:
    • Plant items in soil(aka farmland) and grow a tree that drops that item on the ground
    • Config file that controls allowed types of trees, item drop interval, and likelihood
    • Permissions to control who can plant trees(and what type)
    Download Appleseed: http://dev.bukkit.org/server-mods/appleseed/

    Fertilizer: If trees have the setting "RequireFertilizer" set to "Yes", then they will stop dropping items and require bonemeal as fertilizer to continue. To fertilize a tree, hold bonemeal in your hand and right-click on the very bottom block of the trunk. Fertilizing more than once doesn't hurt, neither will fertilizing while a tree is still dropping items.

    Signs: If a player has permission, they can place a sign on a planted tree that reads "[Appleseed]". The sign will show the type of tree it is, and the color of the text will indicate it's status. If the text is light blue, the tree is an "infinite" tree and will never require fertilizer. If the text is green, then the tree is healthy and dropping items. If the text is red, then the tree requires fertilizer before it will continue dropping items.

    Config File: Remember, the config file is a YAML file, so the indentation is significant.
    • DropInterval: This determines how often items might drop. The default is 60 seconds; any value lower than this might cause lag.
    • FertilizerItem: Item used to fertilize a tree. Defaults to bone meal.
    • MaxUncollectedItems: Optional, approximate maximum number of items that can sit uncollected under a tree
    • MaxTreesPerPlayer: Optional cap on number of trees a player can plant.
    • MaxIsPerWorld: Optional, if MaxTreesPerPlayer is defined, this allows the max to be either per world or server-wide.
    • WandItem: Right click a tree with this item in hand to see its type and fertilizer status.
    • MinimumTreeDistance: Optional, minimum distance between trees.
    • TreeTypes: This section defines the allowed types of trees that can be planted. The following values must be set for each tree type:
      • DropLikelihood: The chance of a drop happening each interval. Can be set from 0-100, where 100 is always drop and 1 is one chance in a hundred intervals. Fractional values now permitted.
      • RequireFertilizer: If set to Yes, the trees of this type will stop dropping items and require bonemeal to continue (if you set this to yes, either DropsBeforeFertilizer or IntervalsBeforeFertilizer must also be set).
      • DropsBeforeFertilizer: Sets the approximate number of drops before the tree gets tired and requires fertilizer (this option cannot be combined with IntervalsBeforeFertilizer).
      • IntervalsBeforeFertilizer: Sets the approximate number of time intervals before the tree gets tired and requires fertilizer (this option cannot be combined with DropsBeforeFertilizer).
      • TreeType: Defines the type of tree that will grow from the sapling. Can be "Standard", "Spruce", or "Birch".
      • MaxFertilizer: Optional, approximate number of times a tree can be fertilized. After the maximum is reached, the tree dies (trunk disappears and the leaves decay).
    Permissions: If you don't have a permissions plugin, then only Ops will be able to plant trees.
    • appleseed.plant.*: This will allow the planting of any item in the AllowedTreeTypes list.
    • appleseed.plant.apple: This only allows the planting of an "apple".
    • appleseed.infinite.plant: Trees planted by a player with this permission will never stop dropping items.
    • appleseed.infinite.fertilizer: Trees fertilized by a player with this permission will never need fertilizer again.
    • appleseed.infinite.cap: This allows a player to plant more than the defined MaxTreesPerPlayer.
    • appleseed.wand: Players can right-click a tree with a wand item(defaults to wooden hoe) to get type of tree and fertilizer status.
    • appleseed.sign.place: Player has permission to place an [Appleseed] sign on a tree.
    Screenshots:

    2011-05-19_15.50.19.png An apple tree with some apples under it.

    2011-05-30_13.22.39.png Two trees with signs. On the left is an "infinite" apple tree, and on the right is a tree that needs fertilizer.

    Video: This video demonstrates how to plant an apple and a cookie. Note that the drop rate has been increased for demonstration purposes.

    Old Changelog (open)
    Version 0.6.4 (08/25/2011)
    • Refactored trees per player counting
    Version 0.6.3 (08/09/2011)
    • Replaced calls to deprecated Bukkit methods
    • Added AllowNonOpAccess parameter to config file for servers without permissions
    • If a player exceeds the maximum allowed trees, the error message will now display the number they have planted and the maximum allowed.
    Version 0.6.2 (07/10/2011)
    • Fix error handling when ShowErrorsInClient is disabled
    Version 0.6.1 (07/01/2011)
    • Fix for "n must be positive" exception
    Version 0.6.0 (06/13/2011)
    • Added optional MaxUncollectedItems config parameter that can prevent items from piling up under trees
    Version 0.5.6 (06/12/2011)
    • Players are prevented from "eating" a seed item if a tree can't be planted for some reason (requested by Joy)
    Version 0.5.5 (06/05/2011)
    • Non-integer DropLikelihood values allowed
    • Configurable per player cap on how many trees can be planted (per world or server-wide)
    • Fertilizer item can be customized
    Version 0.5.0 (05/30/2011)
    • Added support for signs on trees (suggested by kaasinees)
    • Better support for items with damage values
    • Corrected spelling of "fertilizer" in config file (misspelling still works)
    • Added IntervalsBeforeFertilizer parameter to tree type config (suggested by Zarius)
    Version 0.4.1 (05/29/2011)
    • Small tweak to handling of "wrong location" exception.
    Version 0.4.0 (05/26/2011)
    • Fixed a major bug in multiworld saving/loading. If you load this version without restarting the server, ie. with the "reload" command, then you might not lose data. Otherwise the trees outside of your main world will probably be lost. :'(
    • Added config option to enforce minimum distance between trees
    • Added config option to kill trees after some number of fertilizer cycles
    • Added wand item support to show tree type and fertilizer status
    • Allow clicking with wand or fertilizer anywhere on tree trunk
    • Fixed bug with ShowErrorsInClient config flag
    Version 0.3.2 (05/24/2011)
    • Added detection of WorldGuard regions when trees are planted
    Version 0.3.1 (05/23/2011)
    • Fixed bug with permission node "appleseed.plant.cocoa_beans"
    Version 0.3 (05/22/2011)
    • Restructured config file to allow per tree type drop rates and sapling types
    • Trees occasionally stop dropping items and require fertilizer to keep going
    • Added two permission nodes for admins to plant trees that don't require fertilizer, and allow admins to use fertilizer to cause an existing tree to no longer require fertilizer
    • Saving the trees.yml file now runs in a separate thread to improve performance when a large number of trees exist
    • Fixed bug where last tree is not removed from trees.yml (reported by GipsyKing)
    Version 0.2 (05/19/2011)
    • Fixed potential bug that caused some drops to have infinite quantity (reported by walruscode)
    Version 0.1 (05/19/2011)
    • Initial release
    Feature(s) expected for later releases:
    • Config flag to disable initial sapling growth with bonemeal
    • Adjust DropInterval so it uses real time rather than tickrate (for servers with customized tickrate)
    • Bonus items with very low likelihood / configurable "seed" items
    • Suggestions?
     

    Attached Files:

  2. Works fine, until server restart, when apple tree list parsing fails:
    Code:
    2011-05-21 17:52:19 [SEVERE] null loading Appleseed v0.2 (Is it up to date?)
    java.lang.NullPointerException
            at redsgreens.Appleseed.AppleseedTreeManager.ProcessTrees(AppleseedTreeManager.java:45)
            at redsgreens.Appleseed.Appleseed.onEnable(Appleseed.java:44)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    Code:
    -sh-3.2$ cat plugins/Appleseed/trees.yml
    - {itemid: 260, z: 133.0, y: 73.0, world: gansteristan, x: 27.0}
    
     
  3. Offline

    redsgreens

    Is there any chance the world called "gansteristan" was deleted or renamed? That's one occurrence I didn't handle(it'll be handled in the next release). If that's not it, please attach your Appleseed/config.yml and the entire server console output from startup to the exception. Make sure you attach the files, don't paste them in to the body of your reply.
     
  4. Offline

    Joseph Goodley

    This is GREAT! I hope to see this updated because it has POTENTIAL!
     
  5. Offline

    kaasinees

    request to manage settings for individual trees. i want golden apple tree to have a low rate of drop.

    ex
     
  6. Offline

    redsgreens

    I'm already working on implementing this for a future version. I don't think multiple timers is doable, but different chances per item is no problem. I like your idea of configurable seeds, though.
     
  7. Offline

    kaasinees

    Thank you that would be amazing : D i wanted something like this for quite a while now.
     
  8. Nope, no world name changes.
    Files attached, I renamed the .yml extension to .txt so I could attach them.
     
  9. Offline

    Shaegar

    0.2 fixed the -1 infini-apples, thanks!

    This sounds like a great idea, I'd even enable it by default. Make people do a little actual gardening, it's great for immersion. :)

    Also, Redsgreens, do you know if it'd be possible to utilize the different tree types (regular oak, birch, and pine) in this plugin? For example, making all apple trees use the oak skin while all cocoa trees use the birch skin? We're using signs to label the apple trees from the cocoa trees for now, but different tree skins would be great!
     
  10. Offline

    redsgreens

    @GipsyKing: I'll take a look at your files and get back to you.

    @Shaegar: Good idea about the different tree types. The config file is going to get a lot more complex, might as well add one more thing. :p The in-game experience won't be changing much though, don't worry. I'm planning on a new release in the next couple days, we'll see how many of these great ideas I can implement in that time.

    @GipsyKing: it took awhile, but I finally found a bug that occurs when the last tree is chopped down. The bug will be fixed in the next release(almost ready to go), but for now you could delete the trees.yml file to work around the problem. ONLY DO THIS if there is one tree in the file and the plugin crashes at startup.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  11. What about a cake tree? :3
     
  12. Offline

    redsgreens

    Version 0.3 is out. Check the first post for changelog and new info.

    @LegendarySandwich: With v0.3, just add something like this to your config.yml:
    Code:
        cake:
            DropLikelihood: 20
            RequireFertilzer: Yes
            DropsBeforeFertilzer: 20
            TreeType: Spruce
    
     
  13. Offline

    kaasinees

    Please remove the short link and add dates to the changelog/download link; thanks! :D
     
  14. Offline

    redsgreens

    I use goo.gl because Dropbox doesn't have a way of tracking clicks. I added dates to the first post, though.
     
  15. Offline

    kaasinees

    Thank you very much , with a humble bow.

    Hmm trees.yml is empty.. is this normal?

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

    redsgreens

    Not if you've got trees planted. Version 0.3 is a major update, so there could be a major bug somewhere, I guess, but it worked great in my testing. Does the file change when you plant a new tree?

    Attach your config.yml and I'll take a look.
     
  17. Offline

    kaasinees

    Hold on i will check now.

    seems to work.
     
  18. Offline

    redsgreens

    Ok, that's good. It's normal for the file to be empty if there are no planted trees.
     
  19. I'm getting this in my server log:
    2011-05-22 23:35:28 [INFO] Appleseed: ShowErrorsInClient=true 2011-05-22 23:35:28 [INFO] Appleseed: DropInterval=60 seconds 2011-05-22 23:35:28 [INFO] Appleseed: TreeTypes=(cookie,golden_apple,cocoa_beans,apple,cake) 2011-05-22 23:35:28 [SEVERE] java.lang.NullPointerException 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.dataholder.WorldDataHolder.load(WorldDataHolder.java:509) 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder.loadWorld(WorldsHolder.java:358) 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder.initialWorldLoading(WorldsHolder.java:68) 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder.initialLoad(WorldsHolder.java:63) 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder.<init>(WorldsHolder.java:56) 2011-05-22 23:35:28 [SEVERE] at org.anjocaido.groupmanager.GroupManager.onEnable(GroupManager.java:73) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249) 2011-05-22 23:35:28 [SEVERE] at com.nijikokun.bukkit.Permissions.Permissions.onEnable(Permissions.java:64) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249) 2011-05-22 23:35:28 [SEVERE] at com.nijikokun.bukkit.Permissions.Permissions.checkEnable(Permissions.java:99) 2011-05-22 23:35:28 [SEVERE] at com.nijikokun.bukkit.Permissions.Permissions.getHandler(Permissions.java:89) 2011-05-22 23:35:28 [SEVERE] at redsgreens.Appleseed.AppleseedPermissionsManager.<init>(AppleseedPermissionsManager.java:19) 2011-05-22 23:35:28 [SEVERE] at redsgreens.Appleseed.Appleseed.onEnable(Appleseed.java:34) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131) 2011-05-22 23:35:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109) 2011-05-22 23:35:28 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218) 2011-05-22 23:35:28 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205) 2011-05-22 23:35:28 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145) 2011-05-22 23:35:28 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260) 2011-05-22 23:35:28 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:394) 2011-05-22 23:35:28 [INFO] Appleseed: 0 trees loaded. 2011-05-22 23:35:28 [INFO] Appleseed version 0.3 is enabled!

    I use GroupManager.
     
  20. Offline

    redsgreens

    This looks like a GroupManager problem to me, although I'm no GroupManager expert. In the stack trace the exception is being thrown by GroupManager code, not my code, which is what leads me to think it's not an Appleseed problem. Can anybody who else uses GroupManager jump in here?
     
  21. Awesome update!

    Testing now.

    First thoughts: would be so cool if it was possible to make the leaves disappear when th tree is "empty" and grow back when you fertilized it, I guess not possible :p

    ===

    Am I correct in thinking that anyone can Fertilize? Only the planting requires nodes, yes?

    ===

    appleseed.plant.cocoa_beans seems broken, the other nodes work, but players with appleseed.plant.cocoa_beans can't seem to plant them, while it works fine for Admins.

    ===

    Does "dropInterval: 60" use tickrate or real time? If it uses tickrate I need to compensate :p
     
  22. Offline

    Zarius

    Love this idea! :)

    Config file shows it's in seconds.

    @redsgreen

    Would love to be able to limit the number of fertilizer cycles a tree can have before it dies :) I know it's easy to plant another - would be handy to be able to turn off the initial growth via bonemeal too (I don't want it too easy for players :D)

    Oh, and... Great Plugin! :D

    Oh, another idea is the ability to add two (or multiple) drops to the same tree. I would like to allow normal trees have a very low chance of dropping a golden apple (like 0.1 percent chance or less - this needs chance values to be more than just integers though).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  23. I know, however, not all Devs know that 20 ticks does not equal 1 second on bigger servers, while it does on smaller ones, hence me asking :)

    ===

    On another note, I'd like to see something to prevent, what's already happening for us, people stuffing trees really close together to create a farm. Some ideas:

    - Droprate scales somehow with number of leaves on tree?
    - Drops require X leaves on tree
    - No drop if another Tree within X blocks range

    Not sure which works best, code wise :p
     
  24. Offline

    redsgreens

    This falls somewhere between very difficult and impossible. I rely on Minecraft to grow the tree after the sapling is planted, and it doesn't notify me when that happens or what blocks the tree is made up of. This problem is something I've been pondering though.. maybe I'll come up with something.

    Yes, you are correct.

    I'll take a look at this, if it's a bug I'll try to push a new release today.

    The interval is calculated as dropInterval*20, which is based on my reading of the Bukkit Scheduler guide. According to that the tickrate is always 20. How do you go about modifying that value? I wonder if there's somewhere in the Bukkit API where I can retrieve this value..

    1. I'm not sure what you mean by "droprate scales"?
    2. Currently I consider a tree "dead" if it has less than 8 leaves in a 2 block radius around the trunk, at which point it will be removed from the Appleseed database and never drop another item. This number might be too low.
    3. I would prefer to block the planting of trees if they are too close together. The minimum distance separating trees could be defined in the config file. What do you think of that idea?

    This should be fairly easy to implement. I'll add it to my list of features for future releases.

    Great idea :) This one was already on the list.

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

    Zarius

    Looking great :) Yet another idea - visible hanging apples. Check out the Showcase plugin (sourcecode on Github) - it creates some "unpickupable" items.
     
  26. Yea, ideally the tickrate is 20, but that's impossible to reach on servers over 60 or so players, depending on hardware. You can run without major issues down to about 4-5 tickrate, lower than that leads to major pickup/blocklag.

    Ideally you should base the droprate on System.mills, or whatever it's called, of course you still need to use the scheduler for threading, but there's other plugins that do stuff every X "real" seconds, so it's possible.

    2 -> configurable
    and/or together with 3 sounds great!

    Also, about the Showcase suggestion above me, make sure that can be disabled, have had quite some issues with Showcase...
     
  27. Offline

    keithhhhhh

    i love it and will be using it, keep up the good work! :cool:
     
  28. Offline

    redsgreens

    Version 0.3.1 is out to fix a bug with the permission node "appleseed.plant.cocoa_beans".
     
  29. Thanks.

    New issue, well not new, didn't notice before. Planting the seeds entirely bypasses block protection checks. So, for example in an area protected by WorldGuard, owned by player X, any player can just plant seeds in player X's farmland, seeing they grow into huge trees, this leads to a possible griefing issue.

    Would be great if you can fix that :)
     
  30. Offline

    redsgreens

    Are you using WorldGuard, or something else? I am semi-familiar with WorldGuard, but if it's something else this could be a challenge.
     
  31. WorldGuard regions, yes.
     

Share This Page