[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

    1. He, I guess will have to add towny support.
    2. You can't.. well at least I'm pretty sure.
     
  3. Sounds great, cant have people punching holes the houses in my towns :)

    Awww! I wanted to have it so that when killed by a zombie there was a chance to spawn a zombie. Not as fun when you have to have it on any death.
     
  4. Offline

    RugRats

    The best I could recommend is that whenever you die you drop a zombie thats about it :)
     
  5. @RugRats
    Is there a simple way to make sure certain 'rare drops' doesnt trigger when mobs die from mobstraps such as falling, burning or suffocating?

    I had been hoping that removing the tool: entry would do that, but no such luck.
     
  6. Offline

    Celtic Minstrel

    Were you testing on 2.0? Did you check that it wasn't OtherDrops translating the 45 to 13? I'm not sure if I did anything like that in the course of refactoring the code, but it's possible that I might have.


    Specifying tool: CREATURE_ZOMBIE should work. In 2.0 I believe the CREATURE_ part is optional.
     
  7. Offline

    RugRats

    Thats cool! I never knew you could do that :)
     
  8. Works like a charm, thanks :)
    Well, the message part doesnt work.. but its a minor thing.
     
  9. Offline

    Zarius

    Tested on 1.95 and checked the source-code, nothing should be changing the number (although I'll do a more thorough check later with debug messages to make sure).

    Yeah, the message is designed to be sent to the attacker (the zombie in this case). We would need a "messagevictim:" option if you're wanting to alert the player that got killed.
     
  10. Offline

    Chronx6

    messagevictim could be useful for mob kills (a zombie just gutted you!) or for pvp. Theres a few things you could do with it. But I also know you have a large list and are busy. Just thought I'd let you know there is interest.

    Which the mob kill idea brings up the idea of a list of messages to go with a action with a chance for each. Flavor text is fun when used right.
     
  11. @Zarius
    Is Towny support realistic in the near future?
     
  12. Offline

    Zarius

    Oops - checked the 1.95 source and discovered it wasn't checking if the event was cancelled - please try 1.96 with Towny and see if it works.

    @po5 - you might want to try this version with PreciousStones too.
     
  13. It seems to work! I will test it more indept and report back any problem i come across.

    Edit: When a drop is money, can you show the minor currency instead of the larger one?
    Ie, You recieve x silver instead of you recieve 0.0x gold?

    Edit2: event: FIRE/BURN seems to be missing. Im trying to create an event where if you break a powered redstone wire it will start a fire. Uhm, is there even a way to specify REDSTONE_WIRE_ON? At the moment im limited to event: EXPLOSION which i intend to use on breaking DIODE_BLOCK_ON.

    Theese i want to work, obviously i want the player to get electrocuted and not the redstone wire. Perhaps it can be created on broken block and if touching player then you get fried too. Lightning would work if it didnt come from sky but rather from wire to you. If not possible to add suitable gfx, just plain taking damage would work i guess. Fire on other hand can be at broken block, since the idea of fire is to cause structural damage primarily.
    Code:
      REDSTONE_WIRE_ON:
          - chance: 10
            event: ELECTROCUTE
            message: Severing the powered wire has cause it to electrocute you!
          - chance 5
            event: FIRE
            message: The powered wire has caused a fire!
            exclusive:
    
    This one works
    Code:
      DIODE_BLOCK_ON:
          - chance: 5
            event: EXPLOSION
            message: Removing the repeater while powered has caused a catastrophic failure!
    
     
  14. Offline

    Tanite

    Getting a lot of this in the console. This time it was after a server restart and I was the only person to log on (and I didn't log off):

    Code:
    12:52:16 [SEVERE] Could not pass event PLAYER_INTERACT to OtherBlocks
    java.lang.NullPointerException
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksDrops.checkDrops(OtherBlocksDrops.java:339)
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksPlayerListener.onPlayerInteract(OtherBlocksPlayerListener.java:43)
            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)
    12:52:16 [SEVERE] Could not pass event PLAYER_INTERACT to OtherBlocks
    java.lang.NullPointerException
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksDrops.checkDrops(OtherBlocksDrops.java:339)
            at com.gmail.zariust.bukkit.otherblocks.OtherBlocksPlayerListener.onPlayerInteract(OtherBlocksPlayerListener.java:43)
            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)
    
     
  15. Offline

    Celtic Minstrel

    Probably not, since OtherBlocks doesn't know anything about the details of the currency system. If it's possible at all, it would need to be configured in your economy plugin.

    Try this:
    Code:
        REDSTONE_WIRE@RANGE-1-15: # I'm pretty sure this range implies "on" for redstone wire
          - replacementblock: FIRE
    
    It's impossible for lightning to come from the sky, so you'll have to just use the damageattacker key.
     
  16. Offline

    Zarius

    The line it's complaining about is this section for PlayerInteractEvents:
    Code:
            if (block.getRelative(event.getBlockFace()).getType() == Material.FIRE) {
    
    where:
    
            Block block = event.getClickedBlock();
    
    Do you know what you were doing when this triggered? All I can think of is an event that doesn't have a block or blockface? Which is odd because the PlayerInteractEvent is only called for blocks I thought...
     
  17. Offline

    RugRats

    @Zarius

    Code:
    2011-09-05 18:02:45 [SEVERE] Could not pass event LEAVES_DECAY to OtherDrops
    java.lang.NullPointerException
        at com.gmail.zariust.otherdrops.event.CustomDropEvent.isTool(CustomDropEvent.java:182)
        at com.gmail.zariust.otherdrops.event.CustomDropEvent.matches(CustomDropEvent.java:82)
        at com.gmail.zariust.otherdrops.OtherDrops.performDrop(OtherDrops.java:305)
        at com.gmail.zariust.otherdrops.listener.OdBlockListener.onLeavesDecay(OdBlockListener.java:71)
        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)
    Prerelease 4... and
    Add support for heroes.
    If I say make it so you get bark of trees when you use your hand to get a log when it breaks it drops the log and bark ect like I have it but I don't get any exp :O Priority is on high.
     
  18. Offline

    Zarius

    @RugRats - will try and look into that tonight.
     
  19. Offline

    Celtic Minstrel

    Well, I would suspect that if the action is RIGHT_CLICK_AIR or LEFT_CLICK_AIR there might not be a block... but didn't you check the action before checking the block?
     
  20. Offline

    Zarius

    2.0 alpha1 released.

    Changes:
    * removed annoying debug message from pre-release 4
    * fix for specialevents (tree, explosion, etc) - all should work now
    * fix for player drops
    * fix for ranged data (eg. drop: WOOL@0-15 now correctly drops random colored wool)
    * fixed bug with toolexcept
    * verbosity levels of loading and debugs messages tweaked - verbosity low now just says "OtherDrops loaded." on startup rather than 20 lines :)
    * fix for hooking into WorldGuard - this might fix region condition (haven't tested it yet).
     
  21. You the man. 1.96 along with priority highest fixed it.

    Can i do a request? I made some blocks when mined in a specific way yield more resources, but added a chance to find gas pockets, which just means it will blow up in their face. Now i delayed the event, and put a message too. But everything is equally delayed.

    It would be nice if the message was instant, and then the event delayed, so people could run away
     
  22. EDIT: Error found - "damagetool: 2" causes the NPE while breaking a block without tool!

    I need help to fix a null pointer exception with CB1060, Otherblock 1.96:

    Code:
    2011-09-06 20:18:55 [SEVERE] Could not pass event BLOCK_BREAK to OtherBlocks
    java.lang.NullPointerException
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksDrops.checkDropsActual(OtherBlocksDrops.java:607)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksDrops.checkDrops(OtherBlocksDrops.java:139)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocksBlockListener.onBlockBreak(OtherBlocksBlockListener.java:86)
        at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:157)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:481)
        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:89)
        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)
    The only definition I have is this (the error triggers only when a sandblock drop is triggered):
    Code:
    defaults:
        - biomes: ALL
          worlds: ALL
    
    otherblocks:
        SAND:
            - tool: ANY
              drop: SAND
              chance: 30
              damagetool: 2
            - tool: ANY
              drop: NOTHING
              chance: 100
    My intention was to reduce the drops of sandblocks by 30% - works, but the server.log is spammed with the null pointer exceptions!

    Can somebody help me how to fix this or if I did something wrong?
    thx
     
  23. Offline

    RugRats

    @Zarius
    All the file names are OtherBlocks... :O
    Also all the start up messages say OtherBlocks..
    The config files are OtherBlocks..

    This is with 2.0 alpha 1 :)

    and

    Code:
    2011-09-06 14:41:32 [SEVERE] Could not pass event BLOCK_BREAK to OtherBlocks
    java.lang.NullPointerException
        at com.gmail.zariust.bukkit.otherblocks.drops.CustomDrop.isTool(CustomDrop.java:119)
        at com.gmail.zariust.bukkit.otherblocks.drops.CustomDrop.matches(CustomDrop.java:74)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.performDrop(OtherBlocks.java:276)
        at com.gmail.zariust.bukkit.otherblocks.listener.ObBlockListener.onBlockBreak(ObBlockListener.java:86)
        at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:157)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:481)
        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:89)
        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)
    I'm guessing you messed this up pretty bad :)
     
  24. Offline

    Celtic Minstrel

    You'll need to use a drop group; put the message in one "drop" and the delay and event in the other. Drop groups may be broken in the 2.0 alpha though.

    Something like this:
    Code:
      BLOCK:
        - dropgroup: Gas Pocket
          # put your conditions here, such as tool used and such
          drops:
            - message: "You found a gas pocket! Run!"
            - event: EXPLOSION
              delay: 30
     
  25. I got it working thanks :)

    Code:
        COBBLESTONE:
            - dropgroup: Gas Pocket
              tool: ALL
              chance: 100
              drops:
                - message: "You found a gas pocket! Run!"
                - event: EXPLOSION
                  delay: 30
     
  26. Offline

    Zarius

    @po5 @Celtic Minstrel

    Glad you got it working - yeah, dropgroups don't work in 2.0 yet.


    Hmm... I think that's due to the "remove item" part of damage tool (trying to remove an item in your hand when you have none perhaps) - I'll need to remove that feature and separate it out into damagetool: and damageitem: (or removeitem?).

    Oops - no idea why but there was an old file call OtherBlocks-alpha1.zip from about a week ago. Removed it and updated the link to the correct file of OtherDrops-alpha1.zip :D
     
  27. Offline

    RugRats

    @Zarius

    Code:
    2011-09-06 17:57:20 [WARNING] Task of 'OtherDrops' generated an exception
    java.lang.NullPointerException
        at com.gmail.zariust.otherdrops.event.SimpleDropEvent.getRandomMessage(SimpleDropEvent.java:199)
        at com.gmail.zariust.otherdrops.event.SimpleDropEvent.run(SimpleDropEvent.java:280)
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:428)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  28. Offline

    Zarius

    Thanks for that - what were you doing? Is the error often or just during a particular action?

    Nevermind - fixed it locally anyway :D
     
  29. Offline

    RugRats

    All I can say is that i've never seen it before and it was caused by this config
    Code:
    otherdrops:
        COBBLESTONE:
              - tool: ANY
              - chance: 100
              - message: Damn..
              - event: EXPLOSION
                delay: 30
    and

    Code:
    2011-09-06 17:59:20 [SEVERE] Could not pass event BLOCK_BREAK to OtherDrops
    java.lang.NullPointerException
        at com.gmail.zariust.otherdrops.event.SimpleDropEvent.getRandomMessage(SimpleDropEvent.java:199)
        at com.gmail.zariust.otherdrops.event.SimpleDropEvent.run(SimpleDropEvent.java:280)
        at com.gmail.zariust.otherdrops.event.CustomDropEvent.perform(CustomDropEvent.java:474)
        at com.gmail.zariust.otherdrops.OtherDrops.performDrop(OtherDrops.java:313)
        at com.gmail.zariust.otherdrops.listener.OdBlockListener.onBlockBreak(OdBlockListener.java:85)
        at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:157)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:481)
        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:89)
        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)
     
  30. Offline

    Zarius

    @RugRats - yeah, the bug was with messages that didn't include a drop - fix will be in the next build.
     
  31. Offline

    RugRats

    I was also messing with fail configs such as the one above to see what would happen :)
    Also theres no /obr in otherdrops?
     

Share This Page