[MECH] OtherDrops 2.8- Ultimate block/mob/player drop editing [1.5.2]

Discussion in 'Archived: Plugin Releases' started by Zarius, Jun 12, 2011.

  1. Offline

    Zarius

    [​IMG]


    Want to fix glass/stairs/boat drops? Want to gather ice/glowstone/grass in a balanced manner? Want to smelt ore with golden tools? Want to cause chaos with undead that rise again? Now you can, simply by enabling the included example files or delve into the more advanced customisation and make drops work the way you want.

    OtherBlocks aims to give you ultimate control over what item that blocks/entities drop when destroyed, depending on how they were destroyed. Compatible with WorldGuard. Lightweight! Only scans what it needs to and ignores the rest.
    Download: BukkitDev (download link on there) | Source Code

    Included Modules
    * Fix undroppables: fix drops for stairs, glass (don't use your hands - ouch), boats & bookshelves (1.8 stairs included)
    * Gold tools (basic): gold tools have a chance of dropping the complete block for grass, ice & glowstone.
    * Gold tools (smelt): gold tools have a chance of mining an ingot directly from ores.
    * Ore Extraction: using the usual tools, ingots are ripped out of ores, leaving the stone behind.
    * Leaf overhaul: adds leaf drops (apples, cocoa, leaves, sticks & a very small chance of golden apple).
    * Undead Chaos: beware the night! Zombies & skeletons rise again and even players rise back from the dead (player deaths spawn more zombies/skeletons).
    * and more...

    Custom Configuration Examples
    Code:
        # Simple glass drop fix
        GLASS:
          - drop: GLASS
     
        # Players drop Zombies on death, 50% of the time
        PLAYER:
          - drop: CREATURE_ZOMBIE
            chance: 50%
     
        # Spiders killed with any sword at night have a 10% chance to drop web,
        # otherwise they drop whatever they normally would
        CREATURE_SPIDER:
          - tool: ANY_SWORD
            time: NIGHT
            drop: WEB
            chance: 10%
     
        # Trees drop apples (or cocoa from birch trees)
        SPECIAL_LEAFDECAY@GENERIC:
          - drop: APPLE
            chance: 5%
        SPECIAL_LEAFDECAY@BIRCH:
          - drop: DYE@BROWN
            chance: 5%
    
    If you are getting errors with the word "snakeyaml" in it, your config file isn't properly formatted.
    Test it on this website (or this one).

    See the dev.bukkit page for full details on how to set up OtherDrops, a complete parameters list and further examples.


    Changelog

    Newest changelog details here.


    Main author: @Zarius
    Contributors: @Celtic Minstrel, raws
    Original author: @cyklo
     
  2. Offline

    RugRats

    Maybe but... The plugins I have one my test server are exactly the same for my real server except for otherdrops.. and my real server doesn't do this :O
     
  3. Offline

    Zarius

    Yeah, but could be a plugin conflict with OtherDrops and something else that OtherBlocks doesn't have.

    Yeah, the hyphen looks good - though getting a little confusing with @ & - & / but I can't think of a better way :)

    Was planning on abstracting the regions so it would use whatever region plugin is available, as noted :)

    broadcast: sounds good (I was also thinking perhaps message-broadcast to go with message and message-victim).

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

    Rofang

    Have you ruled out double slashes?
     
  5. Offline

    Zarius

    Yes :)

    Unfortunately I think that would be too confusing for users, the dash is better as it's more distinct.
     
  6. Offline

    Cognito guy

    I have it set up like this:

    defaults:

    otherblocks:
    PLAYER:
    - tool: ALL
    drop: NOTHING
    worlds: world

    I want it to drop nothing when a player dies but it still drops all my stuff

    what to do?
     
  7. Offline

    Celtic Minstrel

    I think what I'd do in this case is allow both, so split on "[/-]". (For people who don't understand regex, that means "either / or -".)

    If you're going for consistency, that's always good, so sure.

    Doing that would make the order of parsing matter, because splitting on "/" will also split on "//" and return an empty item.
     
  8. Offline

    nathanaelps

    Welp, still not figuring out the defaults: section. Specifically, not figuring out the worlds: option. Well, it's not working, anyway... Unless I've missed a bit of documentation.

    I have two worlds set up, Interim and Testla. Interim has an economy, Testla is a whole lot more... survival oriented. I want COWs to cost you a buck fifty (or, in server terms, 1.5 bulk) to kill when you're in Interim, but to be free to slaughter in Testla. I also want about thirty other drops to be different between the two, so I'm not very keen to use:

    Code:
    otherdrops:
        CREATURE_COW:
          - tool: ANY
            drop: [email protected]
            world: interim
        CREATURE_SHEEP: (similar)
            world: interim
        CREATURE_CHICKEN: (similar)
            world: interim
        CREATURE_ZOMBIE: (I pay you!)
            world: interim
        CREATURE_SIMIAN: Wait... MC doesn't do monkeys. Oh, well...
            world: interim
        Etc.
    
    I'd so much rather use:

    Code:
    defaults:
      - worlds: interim
    otherdrops:
        CREATURE_COW:
          - tool: ANY
            drop: [email protected]
        CREATURE_ETC. (I got tired of typing.)
    
    It looks like it should be reading the defaults: line, but it's not effective... i.e., it doesn't make any distinction at all.

    Any ideas about what I'm doing wrong?

    I don't get why this particular conversation is relevant, but it's probably because it's not something that I'm doing with my server... yet. But, as a thought, why not just require the percent sign (for the probablity) and do something like this:

    100% DROP 2 BLUE SHEARED SHEEP

    Parse out the block/entity name from a list of blocks: COW COBBLESTONE SHEEP WOOL (etc.)
    Parse out the... adjectives? from a list of adjectives: BIRCH RED BLUE LIME-GREEN REDSTONE(!) SHEARED STICKY (etc.)
    And the probability: (anything that ends in %) ALWAYS(=100%) SOMETIMES(=45%) ALMOST-NEVER(=2%) (etc.)
    Leaving the 2, which fits into the last category. (maybe even allow this to be 'two'?)
    And throwing out the word 'drop', because it's none-of-the-above.

    Code:
        COW: [drop: 75% 1-4 redstone torch]
        GLASS: almost-never drop 1 gold apple
        CYCLOPS: sometimes 1 gold block
    
    Probably not very pretty on the back end, though. After it was parsed, however, the optimist in me says that it'd be just as effective as things are done now. Also, my YAML is probably shoddy.

    (edited because I'm a little bit slow on the uptake sometimes)

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

    Celtic Minstrel

    The defaults issue doesn't look like it's your fault. As for the friendlier parsing you suggest, it isn't actually that much harder than what we have already, but what we have already works fine, is unambiguous apart from this one little detail, is consistent across a number of options, and isn't really unintuitive for people. Really, the hardest part about natural language parsing isn't the parsing itself; it's that you typically need to consider various different ways that it could be said. (I've done this in an IRC bot I run on one IRC server I frequent, so I do know what I'm talking about when I say it's not much harder... though it's in Python, not Java, which makes that easier still.)
     
  10. Offline

    nathanaelps

    (re: the defaults issue) Hm. Well, at least it's not my fault. Lol. Any ideas of a fix? I guess I'll just use the item-by-item setting for now. But Dang, I'm looking forward to using the 'defaults'.

    (re: parsing) So, 'if it ain't broke...' Cool. One other thought, though... Why not use commas instead of hyphens? Thus:

    SHEEP@SHEARED,BLUE/2/100%
     
  11. Offline

    axebyte

    That would be just as good :D ill keep an eye out for when the water thing is added.
     
  12. Offline

    Cognito guy

    I have it set up like this:

    defaults:

    otherblocks:
    PLAYER:
    - tool: ALL
    drop: NOTHING
    worlds: world

    I want it to drop nothing when a player dies from another player but it still drops all my stuff

    what to do?
     
  13. Offline

    Vorsath

    I can't say for sure, but try setting drop as "NODROP"

    Code:
    otherblocks:
    PLAYER:
    - tool: ALL
    drop: NODROP
    worlds: world
    got this from here.
     
  14. Offline

    muddslide

    I'm using 1.96. Here is an example of the stacktrace...


    Code:
    08:53:06 [SEVERE] Could not pass event LEAVES_DECAY to OtherBlocks
    java.lang.NoSuchFieldError: LEAF_DECAY
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksBlockListener.checkWorldguardLeafDecayPermission(OtherBlocksBlockListener.java:50)
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksBlockListener.onLeavesDecay(OtherBlocksBlockListener.java:67)
            at org.bukkit.plugin.java.JavaPluginLoader$32.execute(JavaPluginLoader.java:462)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            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:1966)
            at net.minecraft.server.World.doTick(World.java:1737)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:444)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  15. Offline

    Cognito guy

    Thanks a lot I will test if it works later today
     
  16. Offline

    Darkenvy

    Doesn't seem to work with b1060. I have tried default install and setting values to true. Even the log says these settings load but it just doesn't function.
     
  17. Offline

    TheMap

    Think someone could toss up an example of a specific group gaining bonuses. Example miner class, gains 5% bonus block drop per hit or w/e.

    I cant seem to figure out where to place the group parameter inside the yml so that it defines different groups for different bonuses.
     
  18. Offline

    Zarius

    Ah, I think that this is due to you using an older version of WorldGuard that doesn't support the leaf_decay flag - I haven't coded a workaround for this apart from living with the NPE's or upgrading WorldGuard.

    Odd - can you post the startup messages? Which values did you set to true? Perhaps just try just enabling fix_undroppables and seeing if glass drops glass?
     
  19. Offline

    Celtic Minstrel

    I added support for a per-file default action (since I needed it for something I was making); should we allow tools in the default as well? I don't think they'd be much use there, though.
     
  20. Offline

    Zarius

    Yeah, don't think we really need tools in the defaults.
     
  21. Offline

    Legolas75893

    Suggestion: For broadcast: , maybe a way to add the player's name who triggered it? like '%n alerted the horde!'
     
  22. Offline

    TheMap

    Still no one? The wiki is very vague on the permissions aspect part of separating bonuses per group. I'd like to see a small example if possible as I have no idea where it goes. With by default everyone gains bonuses unlike other older plugins similar, like dropblocks where you have to give permission to gain access, I find it somewhat confusing as to how to segregate different groups so that one may benefit from a certain drop and another not. Someone please explain.
     
  23. Offline

    Zarius

    Sounds good.

    Something like:

    Code:
      STONE:
        - drop: COBBLESTONE # for everyone
    
        - drop: COBBLESTONE
           chance: 5%
           permissions: miners # the just add otherblocks.custom.miners to the group you want to have the bonus
    
     
  24. Offline

    Celtic Minstrel

    @TheMap - there's an example in the od-random_examples.yml file.

    EDIT: Whoops, too slow. <_<

    Hm, on second thoughts.... maybe it would be useful. For reference, here's the config I was starting that required the default actions:
    Code:
    defaults:
        - biomes: ALL
          worlds: ALL
          action: RIGHT_CLICK
          tool: DYE
          
    otherdrops:
        WOOL@WHITE:
          - colour: RED
            replacementblock: WOOL@RED
          - colour: BLUE
            replacementblock: WOOL@BLUE
          - colour: GREEN
            replacementblock: WOOL@GREEN
        WOOL@RANGE-1-15:
          - colour: WHITE
            replacementblock: WOOL@WHITE
    Obviously it won't work for a few reasons; no default tools, and I think colour actually applies to drop, not tool.

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

    Zarius

    Yup, color does apply to the drop. That config looks cool - perhaps it's worth adding default tool & a tooldata or toolcolor option?
     
  26. Offline

    Celtic Minstrel

    Yeah, that was my thought. I may do it after I figure out why right click isn't working at all for me.
     
  27. Offline

    muddslide

    Okay, I'll try to upgrade WorldGuard again. It did seem to be an older version, but I haven't been able to find a more up-to-date version. When I download it, I get the same one. Thanks for you help.
     
  28. Offline

    nathanaelps

    Still not having any luck with defaults:, and my irritation is mounting. :D I'll be thorough with my description this time:

    The .yml file in question:
    Show Spoiler

    Code:
    defaults:
        - worlds: interim
    
    otherdrops:
    
        DIRT:
          - tool: DIRT
            drop: WOOL@ORANGE
    


    The otherdrops section works as expected, which is to say that dirt drops orange wool when you break it with dirt. Unfortunately, it drops the same in both worlds, interim and testla. Unless I'm missing something. Testla is created using PTMBukkit, the Phoenix Terrain mod. Multiworld is managed by MultiVerse.

    otherdrops-config.yml looks like this:

    Show Spoiler

    Code:
    verbosity: normal
    priority: high
    usepermissions: true
    


    Full list of plugins:
    Show Spoiler

    BananaLogArchiver.jar
    BMR.jar
    BorderGuard.jar
    CustomCrafting.jar
    iConomy.jar
    kFeatherTeleport.jar
    LagMeter.jar
    MCDocs.jar
    MultiInv_2.3.2.jar
    MultiVerse.jar
    obuJustShutTheHellUp.jar
    OtherDrops.jar
    Permissions.jar
    PTMBukkit.jar
    RegionMarket.jar
    Scavenger.jar
    SignShop.jar
    SpoutBackpack.jar
    Spout.jar
    WorldEdit.jar
    WorldGuard.jar


    What's wrong? And how do I fix it? I'm getting ready to sacrifice a goat if there aren't any other suggestions!
     
  29. Offline

    Celtic Minstrel

    @nathanaelps – I had the exact same issue with defaults; the thing is you don't need the hyphen, and if you do have the hyphen the entire block will be ignored. It took me forever to figure that out; I was going through the code trying to fix an error that was in the config! (Eventually I showed someone else the config and they pointed it out right away.)
     
  30. Offline

    nathanaelps

    Oh, dang. I wish I were the pope so I could bless you right now. That fixed it. Thanks so much!

    For all you others out there with the same problem, it should have looked like this:

    Code:
    defaults:
        world: interim
    
    otherdrops:
    
        DIRT:
          - tool: DIRT
            drop: WOOL@ORANGE
    
     
  31. Offline

    kahlilnc

    For some reason players do not drop what they had before in there inv???????

    Code:
    2011-09-13 08:31:08 [SEVERE] Could not pass event PLAYER_INTERACT to OtherDrops
    java.lang.NullPointerException
        at com.gmail.zariust.otherdrops.subject.BlockTarget.<init>(BlockTarget.java:42)
        at com.gmail.zariust.otherdrops.event.OccurredDropEvent.<init>(OccurredDropEvent.java:164)
        at com.gmail.zariust.otherdrops.listener.OdPlayerListener.onPlayerInteract(OdPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:139)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:805)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:128)
        at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:478)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Here is my config.
    http://pastiebin.com/?page=p&id=4e6e8d404c34c

    And I cannot get zombies to drop from players death and money either.

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

Share This Page