[MECH/FUN] Fruitful v0.7.4 - Drop apples, cocoa beans, and more from any block [1597]

Discussion in 'Inactive/Unsupported Plugins' started by Patrick Crespo, Jun 16, 2011.

  1. Offline

    Patrick Crespo

    Fruitful - Drop nearly anything from blocks:
    Version: 0.7.4

    I've moved this project to the BukkitDev site. Check there for help and future updates.
     
    Xordaii likes this.
  2. Offline

    Zarius

    Perhaps support different leaf types (generic, birch, redwood) - unless this is already in there? Haven't looked at code yet (as not on my home computer) but GitHub is a good place to post the code (easily browsable, forkable, people can submit patches and a free wiki).
     
  3. Offline

    Patrick Crespo

    I neglected to mention it, but yes, it does support the three tree types as separate configurable entities. I'll post the "default configuration" in a spoiler, also I'll try and figure out how to use Git. Seriously, complete newbie here. :)
     
  4. Offline

    killerrj8

    what is the 0.0003 or 0.002 or o.05 in the configuration ? is it the procent ? and is 1 100% ?
     
  5. Offline

    Patrick Crespo

    Yes, 1.0 is 100% chance. You can actually go above 100% chance if you wanted every block to drop more than one thing, but I haven't extensively tested this, other than to play pranks on my firends with massive "BigSurprises." I'll update the description for a clearer definition.
     
  6. Offline

    Bjourk

    Looks like this is the last up-to-date tree plugin. Congrats! Any chance of toggling tree regrowth like AutoPlant? Thanks!
     
  7. Offline

    Patrick Crespo

    Well, that almost sounds like a different plugin altogether, or at least beyond what I originally intended for this to do, but I'll look in to it.
     
  8. Offline

    VeryInsane

    Will this work with Newest Recommended Build #928?
     
  9. Offline

    Patrick Crespo

    Yup. (Check the title) :)
     
  10. Offline

    VeryInsane

    Oops, sorry. Thanks :)
     
  11. Offline

    RedFawkes215

    I am having an issue with drop rates. I seem to get more cocoa beans than the drop rate I set but I am getting no apples at all even the percentage is higher for apples than cocoa beans. Here is what my config looks like.
    Show Spoiler

    default:
    generic:
    deny-non-player:
    cocoabean: false
    stick: false
    seed: false
    apple: false
    goldenapple: false
    spider: false
    creeper: false
    will-drop:
    cocoabean: true
    stick: true
    seed: false
    apple: true
    goldenapple: true
    spider: true
    creeper: false
    chance-of:
    cocoabean: 0.015
    stick: 0.075
    seed: 0.00
    apple: 0.025
    goldenapple: 0.00001
    spider: 0.0005
    creeper: 0.00
    birch:
    deny-non-player:
    cocoabean: false
    stick: false
    seed: false
    apple: false
    goldenapple: false
    spider: false
    creeper: false
    will-drop:
    cocoabean: true
    stick: true
    seed: false
    apple: true
    goldenapple: true
    spider: true
    creeper: false
    chance-of:
    cocoabean: 0.015
    stick: 0.075
    seed: 0.00
    apple: 0.025
    goldenapple: 0.00001
    spider: 0.0005
    creeper: 0.00
    crop:
    deny-non-player:
    cocoabean: false
    yellowflower: false
    zombie: false
    pumpkin: false
    redmushroom: false
    redrose: false
    creeper: false
    brownmushroom: false
    will-drop:
    cocoabean: false
    yellowflower: false
    zombie: false
    pumpkin: false
    redmushroom: false
    redrose: false
    creeper: false
    brownmushroom: false
    chance-of:
    cocoabean: 0.00
    yellowflower: 0.00
    zombie: 0.00
    pumpkin: 0.00
    redmushroom: 0.00
    redrose: 0.00
    creeper: 0.00
    brownmushroom: 0.00
    redwood:
    deny-non-player:
    cocoabean: false
    stick: false
    seed: false
    apple: false
    goldenapple: false
    spider: false
    creeper: false
    will-drop:
    cocoabean: true
    stick: true
    seed: false
    apple: true
    goldenapple: true
    spider: true
    creeper: false
    chance-of:
    cocoabean: 0.015
    stick: 0.075
    seed: 0.00
    apple: 0.025
    goldenapple: 0.00001
    spider: 0.0005
    creeper: 0.00
     
  12. Offline

    Patrick Crespo

    Hm, it's a little difficult to read the configuration without the correct formatting, (try inserting "code" inside of your spoiler) but if you have permissions, make sure it's fruitful.drop.apple not .apples (Even I've done that one.) Also, with tree drops, it's a little difficult to actually guage how many items will drop, mostly because of the random number of leaf blocks per tree.

    Your config should look something like this (Will only put in the relevant lines):
    Show Spoiler
    Code:
    default:
        generic:
            will-drop:
                apple: true
                cocoabean: true
            chance-of:
                apple: 0.025
                cocoabean: 0.015
            deny-non-player:
                apple: false
                cocoabean: false
    Permissions:
    Code:
    fruitful.generic.drop.apple
    fruitful.generic.drop.cocoabean

    The best way to test, is to get some saplings and some bone meal and go to town. Although I will state that randomness is random in a lot of cases, and sometimes a string of 'luck' can affect the outcome. The way I usually test is by chopping down the trees and then vaccing up the drops; I almost always test with 10 or more trees. Also, which version are you using? (I really should implement a command to tell you what version you're using. :))
     
  13. Offline

    RedFawkes215

    My config file is the one generated by first running the plugin and then stopping the server to configure it so the formatting should be correct. I did plant lots of trees to see how the drop rates were but everything but apples dropped. I set the drop rate to 1 to see if it was just the plugin but then apples dropped which confused me. I was running the plugin by itself so no other plugin would interfere, I also do not use permissions.

    edit* So I went ahead and put it on my server with no changes and it works with apples. I guess it was picky XD but thanks for the great plugin. I am sure those random spiders will give a few players quite a scare.
     
  14. Offline

    Patrick Crespo

    I wonder if it was some strange formatting issue in the file, do you use Windows on your server? If so, you should get a program like Notepad++ to edit the config file. Bukkit might be picky about those newlines. Another possibility would be a non US keyboard, using incorrect codes perhaps.
     
  15. Offline

    RedFawkes215

    I actually made no changes to the config file that was causing me issues, both servers I tested with were Windows and I actually do use Notepad++. Either way it seemed to correct itself when I transferred it to my live server.
     
  16. Offline

    Maniac

    does this work with 1.7?
     
  17. Offline

    Patrick Crespo

    So far, yes. I haven't updated the post yet until I'm sure there's no issues.
     
  18. Offline

    Pythros

    I'm slightly confused with the config, does the generic portion override everything?
    deny-non-player... if options are true, that means explosions will not cause items to drop?
     
  19. Offline

    Patrick Crespo

    The "generic" is one of the tree types. There are three tree types 'generic, redwood, birch,' and then the 'crop' section. If you set a "deny-non-player" to true, then explosions, leaf decay, and water flowing won't make them drop that item. Or at least thats how it's supposed to work. :)

    As a side note, I have the trees set at adhere to the blast yield of the explosion, so by default only 30% of the blocks destroyed will have a chance to drop anything. (Unless you have a plugin that changes the yield.)
     
  20. Offline

    Pythros

    Ah. And if I want to allow anyone get the drops I configure, does giving them fruitful.drop.* and fruitful.crop.* cover it all? Or does that by some imagination give them any kind of drops that are outside the config file? Thanks!

    Edit: Oh and a quick suggestion/request, options as to what can drop out of grass and dead shrubs? ^_^
     
  21. Offline

    Patrick Crespo

    fruitful.drop.* is all you need. You'd use fruitful.crop.* if you want them to only have access to crop drops, fruitful.generic.* for generic trees, etc. So if someone had the following permissions:
    Code:
    fruitful.drop.apple
    fruitful.generic.drop.stick
    fruitful.crop.drop.*
    fruitful.birch.drop.creeper
    They would get anything from crops, sticks and apples from generic trees, creepers and apples from birch trees, and only apples from redwood trees. (If they were configured to drop them.)

    I was considering it, and it'd be somewhat easy to add in, just need to get around to it. :)
     
  22. Offline

    Pythros

    Aha. So if redwood was only configure to drop sticks and spiders, giving fruitful.drop.* will only drop sticks and spiders from redwood and nothing else?
     
  23. Offline

    Patrick Crespo

    Yup. It only drops what you set to true in the config. The permissions are only for physically breaking the blocks, however. Leaf Decay/Water Flowing/Explosions aren't tied to a player, so the permissions have no effect on those types of events, which is why the option for "deny-non-player" is there. I might post a sample configuration that gives a "here is what this does" tutorial to make it a little easier for folks. I know it's certainly a big mess currently. :)
     
  24. Offline

    Pythros

    Make sense now. Thanks. Sorry for all the questions... I'm sure someone else would run into this in the future. :)
     
  25. Offline

    SBD09

    Need help can someone give me the config, all i want is apple to drop from trees and coco beans from wheat can i get the config for that please ?
     
  26. Offline

    Patrick Crespo

    If you want apples from all trees, and cocoa from crops, then your configuration would look something like this:
    Sample (open)
    Code:
    default:
        generic:
            apple: 1, 1:64
        redwood:
            apple: 1, 1:64
        birch:
            apple: 1, 1:64
        crop:
            cocoabean: 1-2, 1:32
    And if you have permissions, and just want everyone to get them, you'd add "fruitful.drop.*" to the user/group.

    Also, while I use 1:64 and 1:32 you can use whatever drop chance you want, where 1:32 means "1 in 32". For example, if you wanted it to be a 5% chance, you could do "5:100" or "1:20".

    The "1" and "1-2" are the range of drops, evenly distributed. So "1-2" means a 50% chance 1 will drop, and a 50% chance 2 will drop, when it's going to drop. You could make apples more, or cocoa less. Any range will do, just as long as it's positive. :)

    If you want a chance for golden apples to drop as well, you would add a "goldenapple: 1, 1:512" line directly underneath all of the "apple:" lines:
    Golden Apples (open)
    Code:
    default:
        generic:
            apple: 1, 1:64
            goldenapple: 1, 1:512
     
  27. Offline

    SBD09

    Thanks it helped a lot :D keep up the good work
     
  28. Offline

    Lykkepillen

    Will older versions of Permissions still work?
     
  29. Offline

    Patrick Crespo

    I just updated the version 0.6 line to have Permissions support again. Older versions (2.7.x, FakePermissions, GroupManager) should work with it. However you still need Craftbukkit 1000 or newer for v0.6 Made a 0.6.2 without Bukkit permissions if you don't have build 1000 yet.

    So, yes. Older versions of Permissions will work. :)
     
  30. Offline

    heronfarm

    Receiving quite a few errors running with Version 1000 of bukkit, every time a leaf decays the following gets dumped to the console:
    Code:
    20:24:27 [SEVERE] Could not pass event LEAVES_DECAY to Fruitful
    java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String
            at me.TheMaestro42.Fruitful.FruitfulConfigurationManager.dropSet(FruitfulConfigurationManager.java:197)
            at me.TheMaestro42.Fruitful.FruitfulChanceHandler.chanceBreak(FruitfulChanceHandler.java:20)
            at me.TheMaestro42.Fruitful.FruitfulBlockListener.onLeavesDecay(FruitfulBlockListener.java:54)
            at org.bukkit.plugin.java.JavaPluginLoader$31.execute(JavaPluginLoader.java:455)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
            at net.minecraft.server.BlockLeaves.g(BlockLeaves.java:124)
            at net.minecraft.server.BlockLeaves.a(BlockLeaves.java:115)
            at net.minecraft.server.World.j(World.java:1951)
            at net.minecraft.server.World.doTick(World.java:1723)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:441)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Anyone else getting this, or is it just me?
     

Share This Page