[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

    Stormbow

    Thanks for the reply, my plugin configuration addled brain forgot to come back after the test.

    That worked perfectly. Definitely one of the very best plugins out there. Thanks!
     
  3. Offline

    Celtic Minstrel

    I think the most intuitive meaning of a list for the drop would be "drop all of these", personally. Maybe others will disagree. Still, I think you should choose one meaning only (either "drop all of these" or "drop one of these") rather than allowing + as a modifier as you demonstrated; that's confusing and doesn't really make the intention clear.

    If I'm not mistaken, both meanings are already possible in other ways already, so adding the support for a list would be merely adding a nice shortcut.
     
  4. Offline

    Zarius

    New release:

    Version 1.81
    * add slime size as datavalue (TINY, SMALL, BIG, HUGE) - or use an integer at your own risk (anything bigger than 32 probably can't move well, and I got graphical glitches with big slimes, eg. 128 :D)
    * added dropspread option (TRUE or a percentage) - drops individual blocks rather than a single itemstack
    * added ore_extraction sample (allow ore to seem to be "extracted" - leaving behind stone)
    * improved permissions system (permissions enabled by default, now honours build rights correctly - otherblocks.active not needed)

    Yeah, it's just a shortcut but can be handy in making config's more readable. You're probably right - leaving the meaning at "drop all" matches the other lists (world, biome, etc)... will keep thinking about it :)

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

    Celtic Minstrel

    Enormously large slimes can move, they're just extremely sluggish.
     
  6. Dropspread, nice :)
     
  7. Offline

    _LB

    I solved the syntax problem - it was an incorrect indentation I had made (I was trying to convert the four space tabbing in your example to the two space tabbing used in the config files), however it still drops one of each item I specify. Other than the fixed tabbing, the code is the same as in my previous post. EDIT: It seems to be creating items in the blocks above my heade 0_0 I'll download the new version and see if it's fixed.

    EDIT: No, still not fixed, it still uses fully grown crops' default random drops.
     
  8. Offline

    Zarius

    @Everyone

    If you downloaded 1.81 and got orange wool from sheep or fire turning to stone - please redownload. Left some testing code in accidentally :/
     
  9. Offline

    enelar

    OREALLY? >_<

    Thanks...
     
  10. Offline

    Zarius

    Hmm... worked fine for me, apart from "tool" in the dropgroup not working (so it dropped apples for every tool) - I'm working on adding this. I tested with this:

    Code:
        CROPS@RIPE:
            - dropgroup: mine
              tool: GOLD_HOE
              drops:
                  - drop: APPLE
                    quantity: 2
                    dropspread: TRUE
                  - drop: EGG
                    quantity: 6-10
                    dropspread: FALSE
    
    I expect the drops appear above the block is due to the block still existing at the time of the drop (it's only removed later). I might be able to swap the code around to fix this but will have to test what effect this has.

    EDIT: Nope - it seems to be affecting all drops - I'm testing reducing the y level for all drops.
     
  11. Offline

    ariennex

    I'm having a uh... strange issue. I loaded up a fresh version of this for my server, and only enabled undroppables. However, when I booted it up shearing sheep yields about 20 orange wool, and the undroppables (boats/glass) don't seem to be working. What manages shears? I can't seem to find which exact part is doing the wool thing, so I can shut that off and deal with the actual stuff I want later.

    *edit*
    Further testing reveals that disabling everything still makes obscene amounts of orange wool drop. It is definitely this plugin causing it, as removing it restores normal wool drops.

    *second edit*
    I deleted everything, redownloaded, and still get butt tons of orange wool.
    I've downloaded 1.8 in the interim, which eliminates the ridiculous wool issue.
     
  12. Offline

    Zarius

    Many apologies - thought I got rid of that :( Try version 1.82 - should fix it (will be standing by to update if anything's broken).
     
  13. Offline

    ariennex

    That fixed it, many thanks :)
    So far I really love this plugin, being able to customize so exactly is great for a primarily RP server like I'm working on.
    One question so far though, and I may just be overlooking something - Can I set up an "either or" scenario for drops? I found how to adjust percentages easily enough, but can I have for example, a certain message display only if an item drops? The way I did it ... doesn't work xD
     
  14. Offline

    Steelstiletto

    02:08:51 [INFO] [OtherBlocks] No values found in config file!
    02:08:51 [INFO] [OtherBlocks] Permissions not enabled in config.
    02:08:51 [INFO] [OtherBlocks] (1.03) loaded.

    I'm running OtherBlocks 1.03, and this is the message that recently started appearing. All of my configs are in other files, and for the most part work. When I kill a zombie, it starts an apocalypse. However, PLAYER's are not dropping things correctly right now, and I am instead getting a bunch of server spam.

    Error (open)
    Code:
    2011-07-30 03:02:21 [SEVERE] Could not pass event ENTITY_DEATH to OtherBlocks
    java.lang.NullPointerException
            at com.sargant.bukkit.otherblocks.OtherBlocksDrops.checkDrops(OtherBlocksDrops.java:228)
            at com.sargant.bukkit.otherblocks.OtherBlocksEntityListener.onEntityDeath(OtherBlocksEntityListener.java:104)
            at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
            at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:141)
            at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:391)
            at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:436)
            at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:179)
            at net.minecraft.server.EntityHuman.d(EntityHuman.java:561)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:858)
            at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  15. Offline

    Zarius

    Hmm - can you post how you were trying?

    Have you tried upgrading to 1.82? I have probably fixed the problem. Edit: yeah, I checked and 1.11 had a fix for player drops.
     
  16. Offline

    Steelstiletto

    I haven't tried updating. I was a bit afraid to, in case there was still an issue with the orange wool. Will anything change about the configs when upgrading?
     
  17. Offline

    ariennex

    :oops: Well the way I was doing it was shamefully wrong. I failed to add the exclusive. Now I'm using

    GLASS:
    - tool: AIR
    drop: NOTHING
    damageattacker: 1-2
    message: "Ouch! Breaking glass with your bare hands hurts like hell."
    exclusive: 0
    chance: 20
    - tool: ANY
    toolexcept: AIR
    drop: NOTHING
    exclusive: 0
    chance: 50
    message: "Aw, the glass broke..."
    - tool: AIR
    drop: GLASS
    message: "That was the sound of you very carefully extracting the glass."
    exclusive: 1
    chance: 80
    - tool: ANY
    toolexcept: AIR
    drop: GLASS
    exclusive: 1
    chance: 50

    This ... almost always works as intended. Occasionally it breaks the glass and doesn't announce it.

    The plugin is amazing btw. Now that I've had more time to play with it... love it! :p
     
  18. Offline

    Zarius

    Yeah, sorry about the wool :/ Definitely fixed now. Nope, your config should work perfectly - let me know if there are any issues.


    Yeah, takes a bit to get used to the options. Keep in mind that 20% chance of one drop and 80% chance of another doesn't mean 100%. What it really means is that the plugin will choose a random number between 0 and a 100 and if it's less than 20 the first item will drop. It then rolls the number again and if it's less than 80 the second item will drop as well. Because the chances are independent there's still a chance that nothing will drop (or any 100% drops, or default).

    Try this:
    Show Spoiler
    Code:
    GLASS:
         - tool: AIR
           drop: NOTHING
           damageattacker: 1-2
           message: "Ouch! Breaking glass with your bare hands hurts like hell."
           exclusive: 0
           chance: 20
     
         - tool: ANY
           toolexcept: AIR
           drop: NOTHING
           exclusive: 0
           chance: 50
           message: "Aw, the glass broke..."
     
         - tool: AIR
           drop: GLASS
           message: "That was the sound of you very carefully extracting the glass."
     
         - tool: ANY
           toolexcept: AIR
           drop: GLASS
    


    This means that for air you'll get nothing 20% of the time with the first message and glass the rest (100%) of the time. Because the first is exclusive it means that if the "ouch" message plays you wont get glass. I wouldn't put exclusive on 100% items because it means that if they happen to roll first they'll always be the only drop.

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

    Zamiel

    Thank you for your hard work Zarius.

    Have you had any chance to work on adding tool: EXPLOSION by any chance?
    Being able to match drops for exploded blocks to our mined ones is one of those things us OCD folks would greatly appreciate, plus who knows what interesting stuff people may come up with.

    (The normal drop chance on explosions is 30%, if memory serves. It'd be good to have included in the documentation for people who want to change drops but otherwise match default behavior.)
     
  20. Offline

    Zarius

    Not yet - will look into it soon, got a bucketload of features on my todo list still (donations can help speed up specific features :D) Yeah, the normal drop is 30%, will put that in documentation when I'm done.
     
  21. Offline

    Adv

    LOG:
    - tool: WOOD_AXE
    drop: LOG
    quanity: 2

    With only CommandBook, HeroChat, Permissions and WorldGuard this custom drop will not work. It dropped 2 like once and now no matter how many trees I hit with a wood axe, they all only drop 1 log. Also, not relating to the previous question, can this plugin handle duping problems? I'm trying to recreate the skyroot tools from the Aether mod but I only want it to work on blocks that have been generated by the world. If players can place a log then break it to get two, that is a duping issue and I'd rather scratch the idea than have it that way.
     
  22. Offline

    Zarius

    WorldGuard uses the wood axe as a special too, no? Have you changed this? If not it could be why the tool isn't working properly.

    Yeah, duping is an issue. The problem is tracking whether a block is created by the world or a player. The only way to work that out is to track every block placement (something that LogBlock or BigBrother does) - I've thought about tapping into these plugins to check if a block has been logged however you'll still run into duping problems if your logging plugin is a bit behind.
     
  23. Offline

    Adv

    Ah left that info out. Yeah I have my WorldEdit wand changed to a goldaxe. As for the duping, that's a bummer.
     
  24. New error:

    Code:
    21:23:42 [SEVERE] Could not pass event ENTITY_DAMAGE to OtherBlocks
    java.lang.IllegalArgumentException: Cannot measure distance between worlds or to null
            at org.bukkit.Location.distance(Location.java:327)
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksEntityListener.onEntityDamage(OtherBlocksEntityListener.java:53)
            at org.bukkit.plugin.java.JavaPluginLoader$58.execute(JavaPluginLoader.java:649)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.EntityArrow.m_(EntityArrow.java:183)
            at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
            at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
            at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
            at net.minecraft.server.World.cleanUp(World.java:1104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  25. Offline

    _LB

    Am I supposed to see a console message from OtherBlocks saying AIR when I right click on mobs?
     
  26. Offline

    Zarius

    No - are you using version 1.82?

    Hmm... that's a good one :) The line in question is:
    Code:
                    Double rangeDouble = e.getDamager().getLocation().distance(event.getEntity().getLocation());
    
    Which is just getting the distance between the player that hit the entity/creature (yes, I check to make sure there was a player that hit it - so neither value should be null).

    Did you get the error often or just once and never seen again? I might add a couple of debug messages and check for null/diff worlds so that it'll keep working in this case.
     
  27. Offline

    dak393

    There are other ways... umm I know the aether mod checks it but I believe they use the terrain generator. Maybe if you checked against the world seed but you would still have problems people placing the blocks back... XD
     
  28. Offline

    ariennex


    Ooh interesting, I understand much better now. Thanks for that! Did I mention this plugin is amazing?! :D
     
  29. Offline

    Zarius

    Yeah, it's tricky :) Something that "tagged" every block destroyed might work but would have to be quick and efficient and would probably need a database like logblock.

    Cool, glad you're enjoying it :D Feel free to ask me if you have any other config queries and share your creations if you want - I like seeing what other people make out of it :)

    I've used this example below for my Sphereworld (called Ascension in my server) - the spheres are surrounded by glowstone rings which I don't want harvested.

    Code:
      GLOWSTONE:
          - drop: NOTHING
            replacementblock: GLOWSTONE
            damageattacker: 2
            message: The gods are angered at your attempt to defile Ascension.
            world: ascension
            exclusive: 1
    
     
  30. Offline

    ariennex

    The orange wool thing got me tinkering with sheep, is there a way to edit shearing sheep drops currently? I made a few fairly feeble attempts, but they just spammed the server with errors.
     
  31. Offline

    Zarius

    Nope, not yet - the orange wool thing was some of my testing code. Works fine but not customisable yet - it will also allow you to customise what drops whenever you right-click on something with an object.

    As time permits I'm currently working on the sheep shearing/punching, fire (eg. hitting fire with bare hands hurts) and drops from explosions.
     

Share This Page