[MECH/FIX] DropPlugin v2.1 - Break blocks, get modified drops (Permissions, LogBlock support) [935]

Discussion in 'Inactive/Unsupported Plugins' started by Juze, May 8, 2011.

  1. Offline

    Juze

    DropPlugin - Break blocks, get modified drops!
    Version: v2.1
    Tested with Permissions 2.7.4-3.1.5b and CraftBukkit #1000
    A collaboration with @ChrizC

    At long last, v2.x is here!

    This plugin changes some drops when some blocks are broken. For example, glass drops glass, wooden stairs drop wooden stairs, ice drops ice... Comes with configuration and Permissions support!

    If Permissions plugin is not found, the plugin uses OPs instead.

    Looking for more custom drops? Here:
    A fair note on updating to v2.x: A lot of things have changed, and it is highly recommended to delete your config file (just in case) and reconfigure your Permissions. After that, you shouldn't need to delete your config file anymore again after an update. :)


    Features:
    • Blocks have different drops
    • TNT explosions can be disabled
    • Permissions support (OP check if not found)
    • Configuration for customization
    • Commands to reload, enable and disable drops
    • LogBlock support
    • Easy to use
    Drops (open)

    These drops can be changed (optional with config and Permissions):
    • Glass - Drop glass!
    • Bookshelf - Drop a bookshelf!
    • Ice - Drop ice!
    • Stairs - Drop stairs!
    • Lightstone - Drop a lightstone block!
    • Mobspawner - Drop a mobspawner! (Note: Pigspawner. Need /mspawn or other command to change the spawn)
    • Grass - Drop grass!
    • Ores - Drop ores instead of ingots!
      • Redstone - Drop redstone ore
      • Diamond - Drop diamond ore
      • Lapis - Drop lapis ore
      • Coal - Drop coal ore
    • Ingots - Drop ingots instead of ores!
      • Gold - Drop gold ingot
      • Iron - Drop iron ingot
    • Stone - Drop stone!
    • Leaves - Drop leaves!
    • TNT - Instead of an explosion, drop TNT instantly like any other block!
    • Cake - Drop cake! (Infinite source of food)
    • Snow block - Drop a snow block!
    • Snow tile - Drop a snow tile!
    • Gravel - Drop flint (100% chance)!
    • Clay - Drop a clay block! (Note: If enabled, does NOT drop clay balls -> no bricks)
    • Logs - Drop 4x wood!
    • Doublesteps - Drop a doublestep instead of two steps!
    • Boat - Drop a boat!

    Download (Latest, wget friendly):
    DropPlugin.zip (.jar)
    Source Code

    Usage:
    Place the DropPlugin.jar in your server's /plugins/ directory, just like any other plugin. Restart your server.

    A configuration file will be generated in /plugins/DropPlugin/ folder. Open DropPlugin.properties with a text-editor of your choise (Notepad++ is great). Here you can disable and enable different drops.

    Finally, if using Permissions, configure your groups to have their appropriate node. For quick install, give 'DropPlugin.drop.*' for your default builder group.

    Issues & To-do:
    Please post any issues on GitHub. Current and previous issues can be found from there too.

    Config (open)

    Default configuration (config.yml) can be found here!
    Show Permissions

    Permission nodes:
    DropPlugin.drop.* - Gives access to all custom drops
    Drops (open)

    DropPlugin.drop.glass - Drop glass
    DropPlugin.drop.bookshelf - Drop bookshelves
    DropPlugin.drop.ice - Drop ice
    DropPlugin.drop.glowstone - Drop lightstone
    DropPlugin.drop.lightstonedust - Drop 9x lightstonedust (Removed in v1.2.1, Beta 1.6.6 has this.)
    DropPlugin.drop.stairs - Drop stairs
    DropPlugin.drop.mobspawner - Drop mobspawners
    DropPlugin.drop.grass - Drop grass
    DropPlugin.drop.ores - Drop diamond/redstone/lapis/coal ores instead of ingots
    DropPlugin.drop.leaves - Drop leaves
    DropPlugin.drop.stone - Drop smoothstone
    DropPlugin.drop.tnt - Drop TNT instead of exploding it! (Works as a nerf) Removed in v1.2.4, use DynaHate instead.
    DropPlugin.drop.cake - Drop cake
    DropPlugin.drop.clay - Drop a clayblock
    DropPlugin.drop.ingots - Drop iron/gold ingots instead of ores
    DropPlugin.drop.flint - Drop flint from gravel
    DropPlugin.drop.snow - Drop a snowblock/snowtile
    DropPlugin.drop.wood - Drop 4x wood from log
    DropPlugin.drop.doublesteps - Drop a doublestep instead of two steps
    DropPlugin.drop.boat - Drop a boat

    DropPlugin.admin.* - Gives access to all administrative commands
    Admin (open)

    DropPlugin.admin.enable - Allows to enable drop in specified world
    DropPlugin.admin.disable - Allows to disable drop in specified world
    DropPlugin.admin.reload - Allows to reload the config for world(s)
    Show commands

    /drops help - Shows the help menu
    /drops enable [name] [world] - Enable drop in specified world (DropPlugin.admin.enable)
    /drops disable [name] [world] - Disable drop in specified world (DropPlugin.admin.disable)
    /drops reload [world] - Reload configuration for specified world (DropPlugin.admin.reload)
    /drops version - Prints the version number

    Changelog:
    Version 2.1 (Download)
    • Added support for LogBlock, as blocks were not logged before this update.
    Version 2.0 (Download)
    • Added help and version commands
      • /drops help - Shows the help menu
      • /drops version - Prints the version number
    • Updates no longer break the config
    • Ice no longer generates water on break
    • Renamed a few config and permission nodes (Glowstone)
    • Added boats
    • Working multiworld configuration (Dev build users, this has been fixed!)
    • Major code cleanup
    • Something I've forgotten to list, this update was huge and took a lot of effort! Enjoy.
    Show changelog

    Version 1.2.4 (Download)
    • Removed TNT support (see DynaHate)
    • Added log to 4x wood as suggested by @ThreeDGuy .
    Version 1.2.3 (Download)
    • I would almost consider this as v1.3 update but rushed with the release of new drops, so it's called v1.2.3.
    • Added snow
    • Added clay
    • Added gravel to flint
    • Added ingots
    • Code cleanup
    Version 1.2.2 (Download)
    • Added cake, yummy.
    • ...that's all, this update is optional.
    Version 1.2.1 (Download)
    • Added redstone ores (Whoops, forgot in v1.2)
    • Removed lightstonedust support since Beta 1.6.6 has this implemented.
    • Fixed reduntant drop modify for gold/iron.
    Version 1.2 (Download)
    • Code cleanup
    • Changed config to .yml
    • Added optional support for leaves, ores, smoothstone, doublesteps and TNT for freebuild servers (also works as TNT-nerf)
    • Fixed GriefAlertR conflict issue.
    • Config bug fixed by @ChrizC , thanks again!
    • I never included this for public download, it's just here in changelog if you want to try it since I released the source for it!
    Version 1.1 (Download)
    • Changed Permissions from dropplugin.* to DropPlugin.*
    • OP check works again (thanks @t3hk0d3 !)
    • Added support for grass and mobspawners
    • Code cleanup
    Version 1.0 (Download)
    • Initial release
    Last words (open)
    This was my first experiment Java and I wanted to see if I could create a plugin. I ended up choosing something easy average but very useful.

    I am still a Java newbie and I would appreciate if you would go easy on me.

    Thanks to people who helped me with a few problems! #bukkitdev IRC

    A special thanks @ChrizC for teaming up together and doing major parts of the code!
     
    emoknight likes this.
  2. Offline

    Juze

    getServer().getWorlds(); only loads the default worlds. Bukkit has a hook WorldLoadEvent for other than Notch's worlds (world, world_nether). Look up WLE.

    https://github.com/Sleaker/NoCivilS.../sleaker/NoCivilSpawns/NoCivilSpawns.java#L84
    https://github.com/Sleaker/NoCivilS...aker/NoCivilSpawns/NoSpawnWorldLoadEvent.java
    (Used with permission from Sleaker)
     
  3. Offline

    ChrizC

    I'm at college at the moment, will look into this later.

    Chris
     
  4. Offline

    Juze

    Working on other stuff too. I'm posting all issues on GitHub right now.

    https://github.com/Juze/DropPlugin/issues/

    v2.0-dev1 out, fixed a few errors in config. Does not fix multiworld issue yet. Added preliminary support for /drops help and /drops version...

    Jar | Zip

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

    RugRats

    I don't use multiverse anymore currently so this will do just fine :D
     
  6. Offline

    Juze

    I'm working hard on getting v2.0 out next week (Today's Sunday). Tested against #935 for now.
     
  7. Offline

    RugRats

    i didn't even know RB935 was out thanks!
     
  8. Offline

    srs008

    okay i'm not sure if it's posted... (too lazy to read another whole topic...)

    but what about disabling item drops for grass, sandstone, wood (natural stuff in other words) for using with movecraft's drill, i have to wait 10 mins after my drill due to that many item drops... so can this be configured for that?
     
  9. Offline

    Juze

    This only modifies the drops, which can be configured on and off (if off, grass drops dirt, for example). It cannot be used to "drop nothing".

    In other words, no. This plugin is not made for your needs.
     
  10. Offline

    srs008

    ahh well, at least i found the /remove in worldedit since then... thanks for a reply though
     
  11. Offline

    wassilij

    LogBlock don't log the breaked blocks .. when you fix that? :(
     
  12. Offline

    Juze

    v2.0 is here, at long last! This is the official release. It still has minor bugs which are almost unnoticeable though, I'll hope to fix them during this and next week. :)
    • Added help and version commands
      • /drops help - Shows the help menu
      • /drops version - Prints the version number
    • Updates no longer break the config
    • Ice no longer generates water on break
    • Renamed a few config and permission nodes (Glowstone)
    • Added boats
    • Working multiworld configuration (Dev build users, this has been fixed!)
    • Major code cleanup
    • Something I've possibly forgotten to list, this update was huge and took a lot of effort! Enjoy.

    Will take a look, most likely I cannot fix it without any API for it, I'm currently waiting for N3X to implement an API to BigBrother too.

    EDIT: The main reason and cause for this is how the drops are handled, "block break is cancelled and the block is set to air" to prevent original drops from dropping. Let's see if there's any workaround the "cancel event"...

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

    Zarius

    There is an API for logblock - was thinking of forking your project and doing a pull request with the changes needed :D It's a fairly simple process when you know how - took me a while because I was doing a silly thing and logging the change after I'd changed the block (which logged "air" - not useful).

    I'm also waiting on the API for BigBrother.
     
  14. Offline

    Juze

    Hmm, I have to take a look at that. Currently testing BigBrother with H2 and see if I can come up with a fix...
     
  15. Offline

    Zarius

    If you're interested here's the pertinent code:

    Code:
    in onEnable:
            final Plugin logBlockPlugin = pm.getPlugin("LogBlock");
            if (logBlockPlugin != null)
                lbconsumer = ((LogBlock)logBlockPlugin).getConsumer();
    
    then a separate function:
        // If logblock plugin is available, inform it of the block destruction before we change it
        public static boolean queueBlockBreak(java.lang.String playerName, org.bukkit.block.BlockState before)
        {
            if (lbconsumer != null) {
                lbconsumer.queueBlockBreak(playerName, before);
            }
            return true;
        }
    
    And I use this in onBreakBlock
    Code:
    queueBlockBreak(event.getPlayer().getName(), event.getBlock().getState());
    
     
  16. Offline

    Juze

    Yup, thanks, I already found the API from thread. ;)

    @vassilij @rakiru @austin101 : v2.1 released. BigBrother is still not supported, but if it helps, I made this little change which you'll hopefully like...
    • Added support for LogBlock, as blocks were not logged before this update.
    (And a small thanks @Zarius for the API, which I already found. :))

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

    Klausar

    Code:
    2011-07-02 11:44:25 [SEVERE] Could not pass event BLOCK_BREAK to DropPlugin
    java.lang.NullPointerException
        at me.juze.DropPlugin.DPBlockListener.onBlockBreak(DPBlockListener.java:108)
        at org.bukkit.plugin.java.JavaPluginLoader$35.execute(JavaPluginLoader.java:483)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
        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:460)
        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:84)
        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)
     
  18. Offline

    Juze

    Which CB# are you using? Are you running multiple worlds?

    Seems like an error with grass for me. I tested breaking grass with config on and off though, I am unable to reproduce your error (though I did spot a similar error before for some reason).

    See if this fixes the problem for you (seems to have fixed for me before): /drops disable grass all

    You can also try enabling it again to reload the config, /drops reload world

    Almost forgot your post here, it should be fixed in v2.0 (latest is v2.1 right now) if you're still interested. :)
     
  19. Offline

    p000ison

    Yeah I love your Plugin especially open source. ;)
    So I could adjust all.
    Yeah a really great plugin. :)

    But is it possible to add BigBrother compatibility? Because BB isn't open source.
     
  20. Offline

    Juze

    It's a known issue, you're going to need for BigBrother API before we can do anything about it.

    An alternative way is to switch to LogBlock, which is 100% supported by this plugin.
     
  21. Offline

    p000ison

    Yes, thx I'll switch to LogBlock. ;)

    Can you add a Admin bypass?
    So that Admins get the orginal drops?

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

    Juze

    I could make such permission node easily, but I don't see much of use for it. In fact, why not just do this in your Permissions config for admins group:

    Code:
    - '*'
    - '-DropPlugin.drop.*'
    That should remove the drop permissions, but leave you with admin permissions. Just add the minus.
     
  23. Offline

    ChrizC

    Or, if you want to remove it only for specific admins, define the -DropPlugin.drop.* in their user permissions definition at the bottom of the file:

     
  24. Offline

    p000ison

    Oh thanks ;D

    Now I've again learned something new. :)

    thx
    yeah really great support an a really great plugin ;)
     
  25. Offline

    p000ison

    Ok a big Bug:

    If i destrop for example glass and drop then one glass, I can make a right click in the air and I get a repaired tool?
    So every tool is unbreakable...

    please fix this!! :'(:'(
     
  26. Offline

    ChrizC

    That doesn't sound like a problem with this plugin.
     
  27. Offline

    p000ison

    Ok I've installed Groupmanager and DropPlugin.
    Then I place a block Glass. I destroy it with hands and one Glass drops.
    Then I destroy one with a pickaxe and then I click right in the air.
    Then I have a new tool. Or a repaired.
    It must be this plugin or? ;)

    The same with bookshelves..
     
  28. Offline

    Juze

    The plugin does not yet degrade your tools and the damage bars are client side, which may bug. It's listed in our issues. I don't really mind that much about -1 dmg to tool, but sure, we're fixing it as I get time to develope this plugin.
     
  29. Offline

    austin101

  30. Offline

    Juze

  31. Offline

    p000ison

    In WorldGuard regions everyone can destros for example glass.
    Please fix these Bugs.
     

Share This Page