Inactive [MECH] ChocolateFever v1.4.4 - Get CocoaBeans, GoldenApples, and Apples From Trees/Crops! [740]

Discussion in 'Inactive/Unsupported Plugins' started by aPunch, Mar 31, 2011.

  1. Offline


    ChocolateFever - Get CocoaBeans from trees and crops!
    Version: 1.4.4

    Don't want to generate a new world just so you can find cocoa beans in dungeons? Want cocoa beans to be more common so you can host cookie parties? Then this plugin is for you! When you break leaves or wait for them to decay, there is a chance that cocoa beans will drop. Also, you can get cocoa beans from crops!

    • Tree Drops: Cocoa Beans, Apples, Golden Apples
    • Crops Drops: Cocoa Beans
    • Configurable drop-rate for golden apples, apples and cocoa beans
    • Decide which trees you want each item to drop from (generic, birch, or redwood)
    • Reload settings in-game
    ConfigurationProperties (open)

    • drop-cocoa-from-crops: determine whether or not to drop cocoa from crops
    • cocoa-from-crops-chance: percent chance of cocoa beans dropping from crops
    • cocoa-from-trees-chance: percent chance of cocoa beans dropping from trees
    • apples-from-trees-chance: percent chance of apples dropping from trees
    • golden-apples-from-trees-chance: percent chance of golden apples dropping from trees
    • generic-cocoa-beans: determine whether or not to drop cocoa beans from generic trees
    • birch-cocoa-beans: determine whether or not to drop cocoa beans from birch trees
    • redwood-cocoa-beans: determine whether or not to drop cocoa beans from redwood trees
    • generic-apples: determine whether or not to drop apples from generic trees
    • birch-apples: determine whether or not to drop apples from birch trees
    • redwood-apples: determine whether or not to drop apples from redwood trees
    • generic-golden-apples: determine whether or not to drop golden apples from generic trees
    • birch-golden-apples: determine whether or not to drop golden apples from birch trees
    • redwood-golden-apples: determine whether or not to drop golden apples from redwood trees

    If you are an Op, you can reload these settings in-game or in the console using the command:
    /[chocolate|choc|cf] -reload
    Known Bugs:
    • Drop-rates are not acting correctly
    Bug Reporting:
    • Read the README.txt in the /plugins/ChocolateFever directory before reporting bugs
    • If you violate one of the rules, I will most likely ignore you

    Changelog (open)

    1.4.4 - made small tweak that may improve drop-rates
    1.4.3 - fixed NPE when leaves decay
    - removed debug message
    - added README.txt file in /plugins/ChocolateFever directory
    - works with CB recommended build #740
    1.4.2 - added ConfigurationManager class (too many config variables to handle in the main class)
    - added /[chocolate|choc|cf] -reload command (can be done via console or in-game; you must be an Op to use it)
    1.4.1 - now comes with generated config.yml in a .zip file
    - switch statements are fun (internal change)
    1.4 - works with CB #726
    - accessor methods are your friend
    - added golden apples
    1.3 - added configurable apples drops
    1.2 - added ability to choose which trees cocoa beans can drop from
    - a bit of code clean-up
    1.1 - fixed configuration not working properly
    1.0 - Initial release.
  2. are the droprates allready fixed?
  3. Offline


    Is it working with 714 ?
  4. Offline


    I think the droprates are to high.

    generic-cocoa-beans: false
    cocoa-from-trees-chance: 0.1
    generic-apples: true
    golden-apples-from-trees-chance: 0.00001
    redwood-cocoa-beans: false
    generic-golden-apples: false
    redwood-golden-apples: true
    birch-golden-apples: false
    redwood-apples: true
    birch-apples: true
    drop-cocoa-from-crops: true
    apples-from-trees-chance: 0.0001
    birch-cocoa-beans: false
    cocoa-from-crops-chance: 0.1

    CB #740
  5. Offline

    Patrick Crespo

    I also had some drop rate issues, where the config file was not only ignoring my drop rate, but every tree would drop 10 or so golden apples with the default config file installed. I read a few posts, and saw one about the random number generator used, taught myself a little java, and devoted ~4 hours to poking around in the source and came up with a 'fix' by changing the Math.random() call to the Random() call instead. I'll link the modified JAR at the bottom, but remember zero credit belongs to me.

    I coded in different defaults to my liking, so be sure and check the config that get's generated, of course. Also, I'd like to point out I'm absolutely no programmer, and you'd be better off waiting for aPunch to actually fix it than use my hack attempt. :)

    Short list of things I changed:
    • Don't check if there's no chance for a drop, (Just playing around with coding)
    • One random roll per decay/break event (No need for three different chances for one block)
    • Sequentially check Golden Apple -> Apple -> Cocoa Bean, so that only one will drop
      (I made that sequence because the least chance for my defaults is Golden Apple)
    • A bunch of naming conventions (in the source) just because I'm strange
    The defaults:
    drop-cocoa-from-crops: true
    generic-cocoa-beans: false
    generic-apples: true
    generic-golden-apples: true
    redwood-cocoa-beans: false
    redwood-apples: false
    redwood-golden-apples: false
    birch-cocoa-beans: true
    birch-apples: false
    birch-golden-apples: false
    cocoa-from-crops-chance: 0.1
    cocoa-from-trees-chance: 0.05
    apples-from-trees-chance: 0.01
    golden-apples-from-trees-chance: 0.001


    Tested fine using Build 740.
  6. Offline


    This is massively broken.
  7. Offline


    I'm going to test this immediately! I've been holding off on downloading the mod because of the drop rate issue. I'll get back to you if it works out. :D

    Not only does it work perfectly, your drop rates are almost exactly what I was aiming for! (I just had to switch it so different trees dropped different things and it was perfect!)

    Awesome :D Hopefully the creator of the mod incorporates your fix so more people can use it.
  8. Nice work Patrick, any chance you could add permissions support? :p
  9. Offline

    Patrick Crespo

    Oh, I could certainly try. What did you have in mind, permissions to the reload command? Or permissions on who can get what from what tree? :) (There is already a permission node for the reload command I believe.) Of course that will mean another crash course in Plugin programming! :)

    Edit: Never mind, after looking at the plugin, I didn't see a permission node, I'll take a look.
  10. Yes, that ^


    Or something :p
  11. Offline


    Thanks to @Patrick Crespo for fixing the drop rate issue. If he is willing, I can incorporate his changes into the official plugin.
    TfT_02 likes this.
  12. Offline

    Patrick Crespo

    If you can sort through all of the unnecessary changes I made and only put in the necessary ones, by all means, please do. :)
  13. Yes please!
  14. Offline


    The414s Version of this :)

    Yes it has permissions,
    working yml
    neat source code
    has a nyan cat.

    Remember to read the README seriously >.>
  15. IT HAS NYAN CAT?!?! Woah awesome!
  16. Offline


    So you will be incorporating patrick's fix soon?
  17. Offline


    Uh.....please don't advertise your plugin in my thread.

    Yes, I will work on it soon. Right now I'm still a bit busy with other plugins.
  18. Offline


    Not sure if this is intended or not but you can get coco beans from destroying crops that haven't matured.
  19. Offline


    Thanks for reporting that! I'll have it fixed in the next release.
  20. Offline


    I have a request for your next release. Could you please add red flowers and yellow flowers to possible drops?

    Flowers are normally a limited resource (unless you use Growbie) so it'd be nice to be able to get them from trees and crops.

    Personally, I want it so I can have it so normal trees=apples, birch=coco, evergreen=flowers.
  21. Offline


    For anyone interested in slight realism, apple, cocoa, oak, and birch are all in the clade Rosids. I've made oaks (generics) drop apples and birch drop cocoa, since apples are more useful early on.
  22. Offline


    I am testing your plugin. and when i turned up the drop rate, sometimes a get more than one apple per leaf block.
    Any idea what could cause that.
  23. Offline


    It would be great if you also added leaf block drops for the different tree types. I could then use this plugin in place of another I am currently using and get more out of it at the same time.
  24. Offline


    hi i have set it up so
    drop-cocoa-from-crops: 0.1
    cocoa-from-crops-chance: true
    generic-cocoa-beans: 0
    birch-cocoa-beans: false
    redwood-cocoa-beans: false
    cocoa-from-trees-chance: false
    generic-apples: true
    birch-apples: true
    redwood-apples: true
    apples-from-trees-chance: 0.05
    generic-golden-apples: false
    birch-golden-apples: false
    redwood-golden-apples: false
    golden-apples-from-trees-chance: 0.01
    but Leaves drop cocoa too why?
  25. Offline

    sexy vampire

    how do i lower appel drops i curently keep geting golden appels over normal ones
    generic-cocoa-beans: false
    cocoa-from-trees-chance: 0.05
    generic-apples: true
    golden-apples-from-trees-chance: 0.05
    redwood-cocoa-beans: false
    generic-golden-apples: true
    redwood-golden-apples: true
    birch-golden-apples: true
    redwood-apples: true
    birch-apples: true
    drop-cocoa-from-crops: true
    apples-from-trees-chance: 0.09
    birch-cocoa-beans: true
    cocoa-from-crops-chance: 0.1
  26. Offline


    How are the drops calculated ? Per tree ? So it resets the moment you hit wood. Or per 100 leave blocks that get destroyed ?

    Also does it alter the droprate of sapplings? It could be a coincidence. But it seems it has lowered alot with the plugin enabled.
  27. Offline

    sexy vampire

    no its just for apples and coco
  28. Offline

    Patrick Crespo

    You have your chance and true/false variables swapped. It should be:
    generic-cocoa-beans: false
    cocoa-from-trees-chance: 0.0
    The plugin calculates per leaf block that breaks/decays to determine if in addition to whatever it drops, an apple, golden apple, or cocoa bean drops. The leaf blocks store the tree type when they're created, so when they break the original tree type determines what that leaf block can drop.

    If you're testing my poor hack version, no I don't know why more than one apple could drop, since the way I have it written, it should drop one item, then stop checking. As for the 1.4.4 version, I did notice interesting drop rates with it, and that caused some issues altogether, which is why I fiddled with the source a little as an experiment.

    Those settings modify the chance that something will drop from a leaf block. Since one small tree can have 20 or so blocks, and one large tree can have over 100, I set them to very small numbers. Unfortunately 1.4.4 has some drop rate issues, so changing the chances may have strange results.

    These are the values I use:
    golden-apples-from-trees-chance: 0.001
    apples-from-trees-chance: 0.01
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  29. Offline


    Am waiting with bated breath for an update to this fun plugin. Just a note on Patrick's fork, I noticed strange behaviour of leaves after installing. Namely if you break a leaf block on a tree new leaf blocks will "grow" randomly about the tree. I'm not sure if it's related to the plugin itself, or another conflicting plugin, but just something to watch for when you come to release the new version aPunch.

    Bring on the chocolate!
  30. Offline


    Dropbox link doesn't work. Getting a 404 for both the jar and the zip
  31. Offline


Share This Page