[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

    Zarius

    I can make them not drop anything and dropping items into a chest is planned (although Tombstone or Cenotaph would be better for that) but can't affect what they spawn with.

    I think there is another plugin called Yet another nodrop plugin our something like that - that does what you want.
     
  3. Offline

    gytis55

    Huh. I redownload and get the same file, same size, same error too.
    You sure you did change the link to it?
     
  4. Offline

    Zarius

    Hmm... I think gitHub might do some odd caching - I definitely deleted it and reuploaded the new one - lemme upload it as beta2.
     
  5. Offline

    gytis55

    Oh, wow, that was fast.
     
  6. Offline

    Zarius

    Just checking to see if I can get any quick bug fixes in with the new release :)

    @gytis55 - new version uploaded, should get beta2 when you download now.

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

    gytis55

    Thanks! Works fine.

    Well, another error report.
    I was just converting my redstone to glowstone dust using this:
    Code:
        REDSTONE_WIRE:
          - tool: GOLD_HOE
            drop: GLOWSTONE_DUST
            quantity: 2
    And then I see- the redstone regenerates. Wait what.
    I check the console. It is spammed with this:
    Code:
    [SEVERE] Could not pass event BLOCK_BREAK to OtherBlocks
    java.lang.NullPointerException
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksConfig.hasDataEmbedded(OtherBlocksConfig.java:125)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksConfig.getDataEmbeddedBlockString(OtherBlocksConfig.java:129)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksDrops.checkDrops(OtherBlocksDrops.java:591)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksBlockListener.onBlockBreak(OtherBlocksBlockListener.java:85)
        at org.bukkit.plugin.java.JavaPluginLoader$36.execute(JavaPluginLoader.java:490)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
        at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:157)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:102)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:458)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
        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)
    Any solution to this? And I haven't used that in earlier versions, so I don't know if this occured or not earlier.

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

    Zarius

    I don't think I've ever tried Redstone Wire - looking into it.

    Odd - it worked fine for me but also got the error message :) It's working ok (other than the message) for you too? edit: Ah, I see what I did - forget to check if a string was null - fixing.

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

    gytis55

    Yes it's working fine except for the message and the redstone reappears after a few seconds for me. :/
    And I still do get the glowstone.
     
  10. Offline

    Zarius

    Fixed in beta3 - please redownload.
     
    gytis55 likes this.
  11. Offline

    gytis55

    Thanks once again!
     
  12. Offline

    Zarius

    Beta4 uploaded (same beta download) - pretty much ready to be called 1.9 if there are no bugs found. Added drop shortcut (drop: droptype/chance%/quantity) and using the percentage in chance (eg "chance: 5%") now works.

    Shortcut example:
    Code:
        DIAMOND_ORE:
          - drop: APPLE/3-6/5%
            tool: [IRON_PICKAXE, DIAMOND_PICKAXE]
    
     
  13. Offline

    Kane

    @Zarius this like DropBonus where I can prevent all mobs from dropping loot unless they use a sword?
     
  14. Offline

    ariennex

    Show Spoiler



    Thanks for posting your ideas, you have some similar ones to what I am working on.
    Is your server public? I am working on a hardcore server for myself and I would love to see what else you've done.

    Also, this plugin is amazingly great. Thanks for all your hard work and for quickly helping everyone out with questions and hotfixing Zarius! You are awesome!
     
  15. Offline

    EMOberger

    otherblocks v.1.8 breaks all protections of glass and maybe other things if undroppables are turned on.

    Not sure if you fixed that in v1.82 (if you did let me know as i can't update yet but will soon)
     
  16. Offline

    Derf321

    Okay thanks, I have that plugin, I was just wondering if I could get rid of redundancies and rely on your plugin. Thanks again! =)
     
  17. Offline

    Haliotro

    I have two questions.

    1. Any idea how I can prevent default blocks from dropping when TNT or a Creeper goes off? I already have the following node being used in a drop group:

    - tool: ALL
    drop: NOTHING

    But this does not seem to pick up explosions etc.

    2. When someone places a torch under sand or gravel, the blocks drop. Any idea how to modify what the drop is? Here I am running into the same problem with TNT and Creepers. Even though I'm using tool: All and drop: Nothing, it is not catching this type of break on a block.


    Thank you for your help!



    P.s. Is there a command to reload just this plugin? I prefer not to have to kick everyone and do a server restart to implement changes (considering some of the other plugins I'm using, I can't just do a /reload all, it would basically be the same as a restart).
     
  18. Offline

    Zarius

    Yes, can definitely do that. The included "overhaul_zarius.yml" file has examples of this (as I nerf mobfarming on my server too).

    Thanks - I try to help where I can :) Yes, my server is public and listed in my signature in the top post but it's not as hardcore as I'd personally prefer as it's a family server that my kids also play on.

    Yeah, I'm pretty sure that should be fixed now - would recommend updating to the beta as most of the bugs have been worked out and it's the only version that includes the "runcommands" action.

    Yeah, I understand that :) I want to avoid this plugin getting too big though, often it's better to have two separate plugins for different functions.

    You're right - I haven't tapped into onPhysicsEvent or onEntityExplode events yet. I'm planning on supporting the explosions (tnt and creepers) soonish - not sure how easy the physics drop can be changed.

    Yes, you can use /obr to reload - will add a commands section to the top post.

    Version 1.9 released - here's the full changelog:

    Version 1.9 (2011/08/10)
    * left/rightclick blocks
    * rightclick entities
    * shear/unshear/sheartoggle events
    * runcommands - allows you to specify commands to run if the conditions are met. Start command with "*" to run as first OP in ops.txt, start with "!*" to suppress OP messages being sent to player (send to console instead), "%p" will be substituted with players name
    * /ob profile - for debugging/speed testing (example usage: /ob profile on, break some blocks, /ob profile blockbreak, /ob profile drops, /ob profile off)
    * FORCETREE - will create a tree on almost anything (excludes things with contents - chest, furnaces and dispensers)
    * damagetool removes items (eg. rightclick with bonemeal, remove 1 or 2 or x bonemeal)
    * fixed ore_extraction - now enforces correct pickaxes
    * shortcut for "drop: droptype/chance%/quantity"
    * replacementblock now supports data values
    * fixed DENY drop
    * fixed dropdata when dropping creatures (eg. can drop SHEEP@RED now)

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

    EMOberger

    I know, i just couldn't update until now. I have a scheduled server maintenance time for my server.
     
  20. Awesome mod, it would be nice if you could build in something else which would allow you, for example, to use a glowstone dust on a cobblestone to turn it into a mossy cobblestone. I tried this with item damage, but i couldn't make the dust disappear :/
     
  21. Offline

    Zarius

    You should be able to do this fine - something like this? (note: clickright is new in version 1.9)

    Code:
      CLICKRIGHT-COBBLESTONE:
        - tool: GLOWSTONE_DUST
          replacementblock: MOSSY_COBBLESTONE
          damagetool: 1
    
     
  22. Thanks, it comes up with this though :/

    2011-08-10 03:48:28 [WARNING] [OtherBlocks]Error while processing block 'CLICKRIGHT-COBBLESTONE' (No enum const class org.bukkit.Material.CLICKRIGHT-COBBLESTONE)
    2011-08-10 03:48:28 [WARNING] [OtherBlocks]Configread: error getting matId for CLICKRIGHT-COBBLESTONE
     
  23. Offline

    Zarius

    Doh, sorry you need to use numbers still for clickright, so use CLICKRIGHT-4
     
  24. First error message is gone, but 2nd is still there lol

    Configread: error getting matId for CLICKRIGHT-4
     
  25. Offline

    Zarius

    Hmm, definitely using 1.9? Also, can you put the verbosity option on"extreme" and see if you get more messages on startup? Did you just copy and paste the config I posted?

    @Just Another Guy

    This works for me (I forgot that replacementblock wont work without a "drop" action) in 1.9:

    Code:
        CLICKRIGHT-4:
          - tool: GLOWSTONE_DUST
            replacementblock: MOSSY_COBBLESTONE
            damagetool: 1
            drop: NOTHING
            chance: 60%
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  26. Offline

    Haliotro

    FYI, the 1.9 version of OtherBlocks has some physics problems with sand and gravel.

    I have sand set to - tool: ALL drop: NOTHING and then allow drops with a shovel.


    If sand is placed, it falls as normal. However, if sand is broken, no physics check takes place to cause the sand to begin falling. I reverted back to your 1.8 version of OtherBlocks until this resolved.

    Otherwise, I do like the new DENY option in 1.9. :)
     
  27. Offline

    Zarius

    Had a think for a bit - turns out there was a solution - new version released:

    Version 1.91 (2011/08/11)
    * replacementblock now honors physics by default
    * new event: NOPHYSICS

    eg.
    Code:
        SAND:
            - drop: NOTHING
            - tool: ANY_SPADE
              drop: SAND
            - tool: DIAMOND_SPADE
              event: NOPHYSICS
    
    Explanation: without a spade there is no drop but still physics, with any spade except diamond there will be sand and physics, with a diamond spade there will be sand and no physics (ie. if there's sand above this block it will hang in mid-air).
     
  28. Thankyou, it works now :D

    Physics seems awesome too
     
  29. Offline

    Celtic Minstrel

    Instead of running as the first op in ops.txt, why not run it as the console? Or, more specifically, as a custom class that extends ConsoleCommandSender and overrides sendMessage to delegate to a player. (And you'd perhaps want to define getName as well since some of the default op commands use it.)

    Also, fix CLICKRIGHT etc requiring IDs already! :p
     
  30. Offline

    Zarius

    I just used RabidCrab's code from his Vote plugin (with permission), I assumed there were some issues with some commands perhaps expecting a player, will look into it. Can you see any other problems (apart from needing to edit the ops.txt file) with the current way?

    K, will look into clickright stuff tonight :D
     
  31. Offline

    Celtic Minstrel

    Not sure; you have a point about commands requiring a player, but in most cases I would think that that player can be specified as an argument to the command using %p. The only problem I can see is cases where a plugin does not process a command when issued from the console, but my impression was that specifying neither * nor !* would cause the command to be issued as if from the player breaking the block, which would mostly render that a moot point. The only possible issue I could still see is that you might want it to run the command as if the player were an op, but with the addition of permissions I suspect that's actually not a trivial thing to do anymore.

    What I suggested with * running as the console but sending messages to the player would work in a similar way to !*, by passing Bukkit.getServer() to the super() constructor of your class extending ConsoleCommandSender. It shouldn't be to hard to do, really.


    Frankly, I feel like this plugin should perhaps see a major rehaul for version 2 that would (partially) break the old config files; you've been adding things and adding things and adding things, and it seems like you have done some things in slightly confusing ways due to the constraints of backwards compatibility. It's nothing major, just a bunch of minor things that are slowly adding up.
     

Share This Page