[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

    Warboy

    there seems to be some kind of incompatibility between otherblocks and groupmanager, my otherblocks config works flawlessly if i disable essentialsgroupmanager.jar, but with it enabled, otherblocks apparently does nothing, even with a * or an otherblocks.* for their permission nodes, i tried to specify the permissiongroups, but there is nothing on your wiki explaining the syntax or USE of this variable, if any.

    even if i strip down the config, and make it something silly like
    Code:
        COAL_ORE:
          - drop: GLASS
            quantity: 20
    it shouldn't even be checking for a permission, right?
    again, with this setting, if i disable groupmanager it works flawlessly, but on enabling it, otherdrops goes dead.
    even at highest priority.
    halp please?
     
  3. Offline

    Zarius

    Hmm... that shouldn't be happening - will look into it. Using the latest version (1.82), no?

    edit: Also, could you put the verbosity onto extreme and post the bit of the log when you attempt to break a block you have configured?

    "permissions" and "permissiongroups" currently only work with Permissions - planning on adding Bukkit Permissions system soon. Yeah, seems I missed those on the wiki, will update.
     
  4. Offline

    Warboy

    with groupmanager disabled:
    Code:
    2011-08-01 20:08:58 [INFO] [OtherBlocks] BLOCKBREAK: after compareto (dropgroup).
    2011-08-01 20:08:58 [INFO] [OtherBlocks] BLOCKBREAK: before compareto (drop: GLASS).
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Starting drop compareto, block.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed data check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed tool checks. (tool = DIAMOND_PICKAXE)
    2011-08-01 20:08:58 [INFO] [OtherBlocks] Checking: world is in list: [null]
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed worlds check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed time check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed weather check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed height check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Skipped range check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed attackrange check.
    2011-08-01 20:08:58 [INFO] [OtherBlocks] Checking: TUNDRA is in list: [null]
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed biome check.
    2011-08-01 20:08:58 [WARNING] [OtherBlocks]Passed ALL checks.
    2011-08-01 20:08:58 [INFO] [OtherBlocks] BLOCKBREAK: after compareto (drop).
    2011-08-01 20:08:58 [INFO] [OtherBlocks] ENTITYDEATH(): Check successful (attempting to drop GLASS)
    2011-08-01 20:08:58 [INFO] [OtherBlocks] Setting replacementblock to null
    2011-08-01 20:08:58 [INFO] [OtherBlocks] BLOCKBREAK(COAL_ORE): doing 1 damage to tool.
    2011-08-01 20:08:58 [INFO] [OtherBlocks] BLOCKBREAK(COAL_ORE): cancelling event and removing block.
    with groupmanager enabled the only notifications i get from otherblocks are:
    Code:
    2011-08-01 20:21:35 [INFO] [OtherBlocks] OnEntityDeath, before damagerList check (victim: CraftCreeper)
    2011-08-01 20:21:35 [INFO] [OtherBlocks] ENTITYDEATH(CREATURE_CREEPER with DAMAGE_FIRE): before check.
    2011-08-01 20:21:35 [INFO] [OtherBlocks] ENTITY_DEATH(Undefined event): before check.
    2011-08-01 20:21:35 [WARNING] [OtherBlocks]ENTITY_DEATH(Undefined event): warning - dropGroups is null!
    2011-08-01 20:22:40 [INFO] [OtherBlocks] OnEntityDeath, before damagerList check (victim: CraftZombie)
    2011-08-01 20:22:40 [INFO] [OtherBlocks] ENTITYDEATH(CREATURE_ZOMBIE with DAMAGE_FIRE): before check.
    2011-08-01 20:22:40 [INFO] [OtherBlocks] ENTITY_DEATH(Undefined event): before check.
    2011-08-01 20:22:40 [WARNING] [OtherBlocks]ENTITY_DEATH(Undefined event): warning - dropGroups is null!
    
    even though we were breaking coal like crazy. i was watching the console the whole time and it was like it wasn't even registering the block break event. also, why is it monitoring mob death events if no other drops are specified?

    on startup i get :
    Code:
    2011-08-01 20:26:52 [INFO] [OtherBlocks] Hooked into WorldGuard.
    2011-08-01 20:26:52 [INFO] [OtherBlocks] CONFIG: loading keys for file: otherblocks-globalconfig.yml
    2011-08-01 20:26:52 [INFO] [OtherBlocks] BLOCK: ALL TOOLS + COAL_ORE now drops 20.0x GLASS@
    2011-08-01 20:26:52 [INFO] [OtherBlocks] readBlock: adding single drop
    2011-08-01 20:26:52 [INFO] [OtherBlocks] CONFIG: creating new blocksHash for: (16)
    2011-08-01 20:26:52 [INFO] [OtherBlocks] CONFIG: otherblocks-globalconfig.yml loaded.
    2011-08-01 20:26:52 [INFO] [OtherBlocks] hooked into Permissions.
    2011-08-01 20:26:52 [INFO] [OtherBlocks] (1.82) loaded.
    2011-08-01 20:26:52 [INFO] [Otherblocks] Payment method found (Essentials version: 2.2)
    full server log (with essentialsgroupmanager enabled)

    full server log (essentialsgroupmanager disabled)
     
  5. Offline

    Zarius

    @Warboy

    Hmm... I note that it says "hooked into Permissions" - are you using permissions and groupmanager at the same time? That's not generally recommended.

    Definitely version 1.82? I can't see anything that would cause that conflict in the latest version (older versions might - they have a permissions check if you set usepermissions: true in the config). Will try out essentialsgroupmanager (I've never tried it before so will take some learning).

    Don't be too concerned about the entity messages - because I can't disable event listeners it still needs to quickly check the entity events ("dropgroups is null" means that it's not finding any config for the event and just skipping out).
     
  6. Offline

    Warboy

    @Zarius
    no, i'm not running both at the same time, essentialsgroupmanager uses fakepermissons (or essentialsgroupbridge) to emulate the permissions plugin. so it would report to any plugin that queried that permissions is installed and running (tho it doesn't emulate permissions 3.0 i think).
    here's my list of plugins (this is a stripped down server to test for incompatibilities)
    Code:
    Borderguard.jar
    Comlog.jar
    Commandsigns.jar
    Essentials.jar
    Essentialsgeoip.jar
    Essentialsgroupbridge.jar
    Essentialsgroupmanager.jar
    Herochat.jar
    MCMA_compat.jar
    Multiverse.jar
    Otherblocks.jar
    Permissionsattributeprovider.jar
    Runecraft.jar (disabled, due to another issue, but included to justify the above plugin)
    Worldedit.jar
    Worldguard.jar
     
  7. Offline

    Zarius

    Hmm... ok, will keep that in mind. You still haven't confirmed the OtherBlocks version number :)
     
  8. Offline

    RugRats

    Code:
    2011-08-01 10:33:41 [WARNING] [OtherBlocks]CONTENTS drop is currently broken :(
    2011-08-01 10:33:41 [WARNING] Task of 'OtherBlocks' generated an exception
    java.lang.ClassCastException: org.bukkitcontrib.block.ContribCraftBlock cannot be cast to org.bukkit.block.Furnace
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.doContentsDrop(OtherBlocks.java:654)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.performActualDrop(OtherBlocks.java:530)
        at com.gmail.zariust.bukkit.otherblocks.DropRunner.run(DropRunner.java:24)
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:438)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    Sad face :(
     
  9. Offline

    jdietz43

    I think I have to get this just because of that last line...

    THE LEAVES ARE NOW DIAMONDS! XP
     
  10. Offline

    Zarius

    Yeah, I suspect it's a change in bukkit :( Was working before and now tells me I can't change types (as in the error above) - haven't been able to find a different way around this yet. On the plus side - in my own testing contents always drop (even if you set drop: nothing) - can you confirm?
     
  11. Offline

    RugRats

    I will.. BRB EDIT: Drop: NOTHING works thanks!
     
  12. Offline

    Zarius

    I'll look into making sure the drop: CONTENTS error doesn't stop things - then I'd recommend still using drop: CONTENTS just in case I get it working in a future version :) eg. if you use drop: NOTHING and you update with a new version that actually makes that drop nothing you could end up with some unhappy players.
     
  13. Offline

    RugRats

    Well drop: CONTENTS for me and my server doesn't drop whats inside and just gives the error! :eek: plus it's only the furnace and i'm the only one that knows about it lol.
     
  14. Offline

    Warboy

    @Zarius
    i kinda did, it was in the server logs and the startup confirmation in my second post:
    2011-08-01 20:26:52 [INFO] [OtherBlocks] (1.82) loaded.
     
  15. Offline

    RugRats

    @Zarius any chance of a tilling update like if you till grass you can config what can be dropped? So if you want to you could say make tilling grass drop seeds again?
     
  16. Offline

    ariennex

    Okay then, I shall eagerly await that update! *starts scheming up fun ways to use this function*
     
  17. Offline

    Zarius

    Sorry, meant that the next version should allow contents to work the same as drop: nothing - then you should use contents because if drop: nothing gets fixed in the future your config wont work properly.

    Yup, the next clickleft/clickright feature will let you do that :)

    Shouldn't be too long now - perhaps tonight.

    Howdy, sorry - missed that bit. Will probably be releasing a new beta version tonight (worked on the code last night but not quite finished) if you could try that out (about 7 to 10 hours from now).

    Debug messages are more consistent and onEntityDamage/Death doesn't run anything (whereas before it gave a debug message and then checked for a configured drop for that particular creature type) if you haven't configured a drop for creatures at all.

    Will also be adding CLICKLEFT and CLICKRIGHT that trigger whenever the player left or rightclicks on something. The config will be something like this:

    Code:
        CLICKRIGHT-COBBLESTONE:
            - drop: DIAMOND
              replacementblock: FIRE
    
        CLICKRIGHT-GRASS:
            - drop: SEEDS
              tool: ANY_TOOL
              event: TILL
    
        CLICKLEFT-CREATURE_SHEEP:
             - drop: WOOL
               event: SHEAR # this one is easy and will be most likely in tonights update
    
        CLICKLEFT-CREATURE_CHICKEN:
             - drop: WOOL
               event: SHEAR # this ones a little harder as I need to store extra info for that particular chicken
    
    
        CLICKRIGHT-CREATURE_SHEEP:
             - tool: SHEARS
               drop: NOTHING
     
             - dropgroup: feed # inspired by ArmEagle's SheepFeed
               message: The sheep chomps down on the food.
               drops:
                 - tool: BREAD
                   event: UNSHEAR # this should regrow wool same color as the original sheep
                   damagetool: 1 # for non-tools this will remove 1 item from the stack
                  delay: 300
                 - tool: WHEAT
                    event: UNSHEAR
                  damagetool: 1 # for non-tools this will remove 1 item from the stack
                   delay: 400
    
        CLICKRIGHT-CREATURE_CHICKEN:
             - tool: WHEAT
               event: UNSHEAR # this should tag the chicken as "ready" to be fed again
               delay: 300
              message: The chicken seems clucky...
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  18. Offline

    Warboy

    just wanted to say, your support for this plugin rocks. keep up the good work.

    edit: oh, another issue just popped up: apparently zeldachickens no longer works, my guess is otherblocks is overriding the player entity hitting chicken entity event with the checks. any way to add a softdependancy or something?
     
  19. Offline

    Zarius

    Nope, doesn't override that yet (test version does, but haven't released that publicly yet) - will look into it.

    note: even when the new version is released it shouldn't affect ZeldaChickens at all unless you add a config for left clicking chickens (and even then I think it should still work, as I'm never cancelling the entityDamage event).
     
  20. Offline

    Warboy

    @Zarius
    sorry about that, turns out zeldachickens was freaking out for a completely different reason.
     
  21. Offline

    Zarius

    No problem, thanks for the update - saves some testing :)

    1.9-alpha1 released - still needs some additional features to fill it out but should work fine.

    Download (left/rightclick blocks - rightclick entities - shear/unshear/sheartoggle events).

    Examples (note blocks currently need to be specified by ID number):
    Code:
        # Fire hurts except with a water bucket
        CLICKLEFT-51: # FIRE
            - drop: DEFAULT
              tool: WATER_BUCKET
              message: You splash a little &bwater&f to put the &4fire&f out.
              exclusive: 1
    
            - drop: NOTHING
              damageattacker: 1
              message: Ouch, the fire burns!
    
            - drop: DEFAULT # put the fire out
              chance: 20          # 20% of the time only
    
        # random example with cobblestone - don't know why you'd want this
        CLICKRIGHT-4: # COBBLESTONE
            - drop: DIAMOND
              replacementblock: AIR
    
        # tilling change and upgrade - drop seeds like old time and only allow tilling on "UP" face
        CLICKRIGHT-2: # GRASS
            - drop: NOTHING # start with a blank slate - ie. don't drop anything unless we say so
            - drop: SEEDS
              tool: ANY_HOE
              face: [UP]
            - drop: DEFAULT # this allows the ground to be tilled
              face: [UP]    # for up face only (ie. not if you click on the side)
        CLICKRIGHT-3: # DIRT
            - drop: NOTHING
            - drop: CREATURE_SHEEP@RED # why not? :D
              quantity: 1-2
              tool: ANY_HOE
              face: [UP]
            - drop: DEFAULT # only allow tilling [UP] face - this prevents a minecraft bug where you can
              face: [UP]            # till dirt stacked under other dirt
    
        # Sheep shearing - needs some way of specifying whether to operate on a sheared sheep or unsheared sheep
        CLICKRIGHT-CREATURE_SHEEP:
            - event: SHEARTOGGLE  # can also use SHEAR and UNSHEAR as events (for sheep only)
              toolexcept: SHEARS
            - drop: WOOL  # currently this will occur whether the sheep is sheared or not, working on a solution
              quantity: 2-3
              toolexcept: SHEARS
    
            # disable shears
            - drop: NOTHING
              tool: SHEARS
    
            - dropgroup: feed # inspired by ArmEagle's SheepFeed
              message: The sheep chomps down on the food.
              drops:
                - tool: BREAD
                  event: UNSHEAR # this should regrow wool same color as the original sheep
                  damagetool: 1 # for non-tools this will remove 1 item from the stack
                  delay: 300
                - tool: WHEAT
                   event: UNSHEAR
                  damagetool: 1 # for non-tools this will remove 1 item from the stack
                   delay: 400
    
           # this could be a special effect allowed by another plugin - the other plugin could give the player the
           # 'otherblocks.custom.stonezap' permission for a limited time and remove the permission after
            - drop: NOTHING
              tool: STICK
              replacementblock: STONE
              permissions: stonezap
    
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  22. Offline

    RugRats

    works great but
    Code:
    2011-08-02 13:32:18 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'ob' in plugin OtherBlocks v1.9-alpha1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java: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)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.onCommand(OtherBlocks.java:215)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    
    Get this when I use /ob
     
  23. Offline

    Celtic Minstrel

    Checking against world seed, even if that were a plausible method, would not count planted trees as natural (except by coincidence).

    Wouldn't that be more like tagging every block placed? Certainly seems like too much work for too little gain though.

    But that's such a perfect opportunity for lightning! :p

    This error is clearly related to BukkitContrib, though it also sounds like OtherBlocks might be missing the getState() call... incredibly unlikely though it sounds. But why is CONTENTS drop broken anyway?
     
  24. Offline

    RugRats

    thank you for adding the tilling stuff for me btw :p
     
  25. Offline

    Zarius

    Actually - that drop did have lightning but I for some reason my "ascension" world has weather disabled :/

    Just a coincidence that it's BukkitContrib - still errors without it:

    Code:
    07:59:08 [WARNING] Task of 'OtherBlocks' generated an exception
    java.lang.ClassCastException: org.bukkit.craftbukkit.block.CraftBlock cannot be cast to org.bukkit.block.Furnace
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.doContentsDrop(OtherBlocks.java:703)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.performActualDrop(OtherBlocks.java:579)
        at com.gmail.zariust.bukkit.otherblocks.DropRunner.run(DropRunner.java:24)
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:438)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    You're right - I changed the code around to try it without the blockstate. With the original blockstate code I get this error:

    Code:
    08:02:29 [WARNING] Task of 'OtherBlocks' generated an exception
    java.lang.ClassCastException: org.bukkit.craftbukkit.block.CraftBlockState cannot be cast to org.bukkit.block.Furnace
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.doContentsDrop(OtherBlocks.java:704)
        at com.gmail.zariust.bukkit.otherblocks.OtherBlocks.performActualDrop(OtherBlocks.java:579)
        at com.gmail.zariust.bukkit.otherblocks.DropRunner.run(DropRunner.java:24)
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:438)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Thanks for that - wasn't checking if the first argument ("show") was actually being typed, fixed in local build.

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

    oqenscool

    can you add iConomy support?
    so if you kill a mob you gain money.
     
  27. Offline

    Zarius

    Already there, it's in the features list :)

    Here is an example:
    Code:
      CREATURE_ZOMBIE:
        - drop: MONEY
          quantity: 1.5-7
          message: The zombie dropped %q dollars.
    
     
    oqenscool likes this.
  28. Offline

    Cultist O

    It is very unclear between the first post and the wiki whether or not I am supposed to include percentage signs after the chance values. You should probably make it consistent, or mention that it does not matter, either way I would like to know.
     
  29. Offline

    oqenscool

    yeah thank you <3
     
  30. Offline

    Zarius

    Doesn't matter if you put it or not. I find it easier to read and clearer for people to know it's a percentage with it there but you can leave it out with no problems. Will update the wiki, thanks for that.
     
  31. Offline

    Celtic Minstrel

    I was under the impression that lightning worked in all worlds, whether normal, nether, or skylands... unless you have a plugin blocking it?
     

Share This Page