[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)
        [email protected]:
          - drop: APPLE
            chance: 5%
        [email protected]:
          - drop: [email protected]
            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

    Celtic Minstrel

    The code for that is in the run() function in SimpleDropEvent.java and also in the function in OtherDrops called performDrop or something similar. The reason it's a complex corner case is that there is no way to ask Bukkit what the default drops should be, and simply cancelling the event cancels everything, including the drop, the tool damage, and the block being broken. We want "drop: NOTHING" to only cancel the drop, but allow the block to break and the tool to be damaged; "drop: DENY" is a shorthand for cancelling both the drop and the break. I don't know if Zarius wanted DENY to cancel tool damage; for me, it would make sense either way. Then to cancel the break while allowing the drop and the tool damage, you'd use something like "replacementblock: SELF" (note, this doesn't currently exist), and to cancel the tool damage while allowing the drop and the break, you'd use "tooldamage: 0".

    Unfortunately, cancelling the entire event is currently the only way to prevent the drop from occurring, and the only way to prevent the break from occurring (if you use replacementblock and the event doesn't end up being cancelled, Minecraft will continue going through with the drop, but using the new block instead of what was there before). I think it's even the only way to prevent the tool from being damaged. There's currently no way in Bukkit to isolate the three things.

    I have a pull request pending that at least allows the drop to be isolated, so if that get pulled it'll at least be progress in the right direction.

    EDIT: There may also be a way to isolate the "break"; I seem to vaguely recall seeing that somewhere. I'm not sure it would have the desired effect, but I can look into that.
     
  3. Offline

    Zothen

    Arf, sry for my short-sightedness - ofc its a bit more than just to cancel an event.. Just noticed my failure while digging the source. "Pull request" came up to my mind when I saw the problems of blockbreak and drop isolation... But was already too late to change my earlier post! Well, was a long day already...
    However, thanks for your explanation - it brought more light into understanding of the code, but I still need to dig deeper before I understand most of it.
    Hope your vaguely recall becomes more clear and might lead to a solution for that problem! I wouldnt like to abandon this new server concept, but without a way to reduce drops its pointless..
     
  4. Offline

    slimpyman

    i looked at the deafault configs and lookin at the ore extraction, i just decided to removed the

    DIAMOND_ORE:
    - replacementblock: STONE
    drop: DIAMOND
    tool: [IRON_PICKAXE, DIAMOND_PICKAXE]

    - replacementblock: STONE

    and it doesnt drop...

    dont i need to do the
    -tool : IRON_PICKAXE
    and then it will drop properly?
     
  5. Offline

    Celtic Minstrel

    I'm not really sure what you're asking. Can you clarify?
     
  6. Offline

    iarspider

    2.0 beta 7:
    Code:
    12:33:33 [SEVERE] Could not pass event PLAYER_INTERACT_ENTITY to OtherDrops
    java.lang.NullPointerException
            at com.gmail.zariust.otherdrops.data.ContainerData.<init>(ContainerData.java:68)
            at com.gmail.zariust.otherdrops.subject.VehicleTarget.getVehicleData(VehicleTarget.java:61)
            at com.gmail.zariust.otherdrops.subject.VehicleTarget.<init>(VehicleTarget.java:51)
            at  com.gmail.zariust.otherdrops.event.OccurredDropEvent.getEntityTarget(OccurredDropEvent.java:471)
            at com.gmail.zariust.otherdrops.event.OccurredDropEvent.<init>(OccurredDropEvent.java:204)
            at com.gmail.zariust.otherdrops.listener.OdPlayerListener.onPlayerInteractEntity(OdPlayerListener.java:50)
            at org.bukkit.plugin.java.JavaPluginLoader$12.execute(JavaPluginLoader.java:337)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:903)
            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:92)
            at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    
    Code:
    16:31:58 [SEVERE] Could not pass event PLAYER_INTERACT_ENTITY to OtherDrops
    java.lang.NullPointerException
            at com.gmail.zariust.otherdrops.data.ContainerData.<init>(ContainerData.java:68)
            at com.gmail.zariust.otherdrops.subject.VehicleTarget.getVehicleData(VehicleTarget.java:61)
            at com.gmail.zariust.otherdrops.subject.VehicleTarget.<init>(VehicleTarget.java:51)
            at com.gmail.zariust.otherdrops.event.OccurredDropEvent.getEntityTarget(OccurredDropEvent.java:471)
            at com.gmail.zariust.otherdrops.event.OccurredDropEvent.<init>(OccurredDropEvent.java:204)
            at com.gmail.zariust.otherdrops.listener.OdPlayerListener.onPlayerInteractEntity(OdPlayerListener.java:50)
            at org.bukkit.plugin.java.JavaPluginLoader$12.execute(JavaPluginLoader.java:337)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:903)
            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:92)
            at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    
    From looking at the stack trace, I guess it conflicts with MinecartMania?
     
  7. Offline

    Zothen

    I think the space in [IRON_PICKAXE, DIAMOND_PICKAXE] after the comma is not your friend!
     
  8. Offline

    Celtic Minstrel

    This seems unlikely...?
    No, the space is fine.

    Wow, this was dumb. That null pointer exception is because I forgot to initialize the set I was adding stuff to, meaning that I was trying to add stuff to null. I've fixed that, so it should finally work in the next beta.

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

    Trielkin

    Does this plugin add mobs drop money too?

    If not can you please add it in i need to make A total RP server
    and im in need for a mob money plugin and other drops from mobs thanks
     
  10. Offline

    sparroha

    can we get this plugin plugged into perms 3.1.6 plz?
     
  11. Offline

    Celtic Minstrel

    Yup, if that's what you put in your config file.
    In theory it should already work with Permissions 3, but you should really move away from that; it won't be supported very long beyond 2.0.
     
  12. Offline

    Zothen

    @Celtic_Minstrel , Ive seen that other plugins that try to modify the drop ratios have the same problem that OtherDrops has (tool damage issues) - is there any way to support the pull request for bukkit that youve mentioned? And where are pull requests filed?
     
  13. Offline

    Celtic Minstrel

    Pull requests are on github. I think the Bukkit team is unsure of this particular one because it's a fairly significant change and they want to make sure it actually works as advertised. I think they're reasonably likely to accept it, but I dunno if they actually will.

    I don't think there's a way to "officially" support the pull request really.
     
  14. Offline

    user1234567890

    Is this spout-compatible?
     
  15. Offline

    Zarius

    There's no extra features via Spout though it should work fine.
     
  16. Offline

    user1234567890

    Ok, just wondering. I am an administrator on a server that has used your plugin for a very long time. We recently added Spout to our plethora of plugins, and, although we have made no significant changes to the configuration of our drops, it would appear that they are no longer working properly, though we do not get an error message. I have no reason to believe that Spout is the cause of the problem other than that it began to occur around the same time as that plugin's addition.
     
  17. Offline

    Zarius

    Which version of OtherDrops? I've been away a while but I think there's a few bugs in beta's 6&7.
     
  18. Offline

    sparroha

    perms 3 is the best perms plugin out there. saddness if it stops being supported by plugins.
     
  19. Offline

    user1234567890

    I'm not sure, actually. I'll check on that and get back to you.
    You or one of your colleagues talked to the owner of the server, Legolas75893. I don't think the conversations were particularly fruitful. I don't know if the issue of Spout came into question or not, but I'll investigate the matter either way.
     
  20. Offline

    Celtic Minstrel

    It won't be supported because it's not being maintained. If someone came along and updated it to manage superperms, all existing plugins that use superperms for permissions would support it again. However, such an effort would not be very fruitful. I suggest you check out PermissionsEx, if you like Perms3 so much; of the existing systems, it's probably the most like the old Permissions.
     
    EmpiricalDepth likes this.
  21. Offline

    user1234567890

    We are running Beta6. Is Beta5 compatible with the current version of Bukkit?
     
  22. Offline

    Celtic Minstrel

    I really have no idea what's compatible with what anymore, except that I'm pretty sure beta7 is compatible with latest (though it could throw method not found errors on rare occasions).
     
  23. Offline

    diannetea

    Just thought I'd test this out, and I tried:

    Code:
        BOAT:
            - tool: ALL
              drop: BOAT
    causes boats to be duplicated and not destroyed, using beta 7

    Also I set it to extreme for a moment to see if I could figure it out, but.. nothing:


    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] Vechicle drop occurance created. (BREAK on [email protected])
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] PerformDrop - checking for potential drops: action = BREAK target = [email protected]
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] PerformDrop - potential drops found: [BREAK on BOAT] tool: [email protected] with [email protected]
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] Tool match = true - [email protected] with [email protected] tools={ANY=true}
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] PerformDrop: dropping BOAT
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] Performing SimpleDrop...
    2011-10-18 01:40:22 [INFO] [OtherDrops:2.0-beta7] SimpleDrop: dropped BOAT x 1.0
     
  24. Offline

    Zarius

    @diannetea

    Hmm, I fixed that problem back in Beta 5 - looks like it snuck back into Beta 7, will look into it.
     
  25. Offline

    Celtic Minstrel

    Oh I see... I removed the special case for that because the generic code should have been able to handle it, but the generic code was only being executed if it was a block. I've removed that check; hopefully it'll fix it.
     
  26. Offline

    user1234567890

    Any known incompatibilities with other mods? We're kinda desperate; we should've been able to launch two weeks ago, but drops not working has made that impossible.
     
  27. Offline

    Celtic Minstrel

    I don't know of any incompatibilities, but it's likely incompatible with any plugins that do anything on block break or entity death. That's by no means guaranteed, and it does depend on your config; however it's pretty likely.
     
  28. Offline

    user1234567890

    OK I'll keep that in mind, thank you.

    Found about four plugins that could be causing the problem. Creator is AFK at the moment, I'll see if he can check later.

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

    diannetea

    I'm trying to get mob spawners to drop both money and xp, but I get the same types of errors regardless of what I use. I tried both @ and / but neither seem to work?

    Code:
        MOB_SPAWNER:
            - drop: [email protected]
            - drop: XP/25
            - tool: ANY_PICKAXE
              drop: CONTENTS
    
    
    results in:
    
    2011-10-18 21:18:25 [WARNING] [OtherDrops:2.0-beta7] Invalid data for MONEY: 250
    2011-10-18 21:18:25 [WARNING] [OtherDrops:2.0-beta7] Invalid data for XP: 0
    


    So I moved the drops down under the tool section and they work now, but I had previously had them set up with tool ANY and it wasn't working.

    And it isn't giving out the rewards. :(
     
  30. Offline

    Zarius

    Have you tried the older 1.96 version? You can grab it from the "Older Downloads" link. It might get you up and running until the next beta (which should hopefully resolve many of the current bugs).
     
  31. Offline

    Celtic Minstrel

    Note that the older version lacks several of the features of the newer version. However, if you don't need those features...
     

Share This Page