[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

    If anyone is interested in testing v1.3, here's a download link to latest dev build:

    http://dl.dropbox.com/u/18028516/DropPlugin/dev/DropPlugin.jar
    Dev Source Code

    Please report any bugs. There are few missing features and few issues which will be fixed in v1.3 release. Remember that this is for testing only. Dev builds are not especially made for large servers to run, they may have bugs or cause instability.

    Known issues:
    • Console commands don't work, results in NPE
    Changes:
    Thanks to ChrizC for most of these!
    • Config now updates itself on update
    • New configuration, using nodes
    • Old config will be changed to new config
    • Changed DropPlugin.drop.lightstone to DropPlugin.drop.glowstone
    • Added reload/enable/disable commands
      • /drops reload - Reloads config
        • DropPlugin.admin.reload
      • /drops enable <block> - Enables block drop in config
        • /drops enable glass - Glass drops glass
        • DropPlugin.admin.enable
      • /drops disable <block> - Disables block drop in config
        • /drops disable glass - Glass works like vanilla (drop nothing)
        • DropPlugin.admin.disable
    • Added support for boats
      • Boats drop boats
      • DropPlugin.drop.boat
    • Rewrite of code (Code cleanup)
     
  3. Offline

    ChrizC

    Just an update on my part - working on multiworld config.
    The way I'm doing it is, each world will have a separate config file. I will update commands so that the enable/disable commands will have this structure:
    /drops disable/enable [world] <block>
    (so if you omit [world], it will change it for the world your character is currently in, otherwise will change it for [world] if it exists)

    Chris :cool:

    Another update - finished multi world config.
    For each world on your server, a file called <worldname>_config.yml will be created in the plugin's data folder.
    You can then update these in a text editor, and reload specific world configurations by issuing the /drops reload <worldname> command. This means that you do not have to fully reload the plugin/all plugins.

    Enabling/disabling drops is done by the command:
    /drops (enable/disable) [world] <block>
    The [world] argument can be left out. If this is the case, the drop will be enabled for the world that the issuer is in.
    [world] is (as far as I can tell) case-insensitive. block is case-insensitive.

    **These changes are not currently available for use on your servers. You will have to wait until Juze approves my changes and updates the dev-build link**
    Chris :cool:

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

    rakiru

    Any chance of adding LogBlock and WorldGuard support to this?
     
  5. Offline

    ChrizC

    I'm currently looking into WorldGuard support.

    Chris :cool:
     
  6. Offline

    rakiru

    Ah, brilliant. How about Residence? :p
    But seriously, if you get LogBlock support added, I will definitely be using this.

    Edit: I'll look into it myself and possibly fork it on Github and try it.
     
  7. Offline

    Juze

    @ChrizC : Sounds good to me. I would only change the command format to "/drops disable glass world2". Also, "/drops disable glass all" would disable it in all worlds.

    Yet more further, the worlds should be seperated as "/plugins/DropPlugin/world-name-here/config.yml". :)

    Going to a LAN party now, won't do much coding.
     
  8. Offline

    ChrizC

    Update on BigBrother compatibility issues:
    During the summer, BigBrother author N3X15 is creating an API for BigBrother. This will allow us to fix the problems the plugin has with BigBrother not recognizing block breaks through this plugin.

    Chris :cool:
     
  9. Offline

    ChrizC

    ANOTHER update from me:

    I've restructured the way DropPlugin stores each config file. Now, for every world, a folder will be created. In that folder will be a config.yml

    I've also restructured the commands, and added the ability to do commands from console.
    The enable/disable commands are now structured:
    /drops enable/disable <block> [world]
    World is optional except in console.

    I've also changed the command labels. You can now no longer use /drop, it is /dropplugin or /drops.

    I think that's all from me. Expect an update and (hopefully) a release from @Juze soon!

    Chris :cool:
     
  10. Offline

    Juze

    v1.3-dev2 will be out soon for testing. Will release it after I get some sleep, source is already on Git for those who want to compile it.

    Yawn, couldn't sleep as this bothered me. Here, grab v1.3-dev2 for testing.

    Download: (v1.3-dev2)
    ZIP | JAR | Source

    Download the DropPlugin.zip if you want to edit the config before updating. If you're coming from earlier version of DropPlugin, .jar file should be enough.

    Changes:
    • Multiworld config (config.yml) now has it's own folder for each world
    • Restructured /drops, removed support for /drop, added alias /dropplugin.
    • Commit changes
    To-do:
    • /drops help - v1.3 release
    • Fix ice flooding water issue - v1.4 release
    • Fix BigBrother conflict as N3X gets the API out - v1.4/v1.5 release
    v1.3-dev1 is now unsupported but still up for grabs: http://dl.dropbox.com/u/18028516/DropPlugin/v1.3-dev1/DropPlugin.jar
    v1.2.4 - Stable build: http://dl.dropbox.com/u/18028516/DropPlugin/v1.2.4/DropPlugin.jar
    Permament link to latest dev builds for wget: ZIP | JAR

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

    RugRats

    @Juze

    2011-06-21 19:52:31 [SEVERE] Could not pass event BLOCK_BREAK to DropPlugin
    java.lang.NullPointerException
    at me.juze.DropPlugin.DPBlockListener.onBlockBreak(DPBlockListener.java:101)
    at org.bukkit.plugin.java.JavaPluginLoader$35.execute(JavaPluginLoader.java:482)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:159)
    at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:456)
    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:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-06-21 19:52:31 [SEVERE] Could not pass event BLOCK_BREAK to DropPlugin
    CB860 newest DP
     
  12. Offline

    Juze

    How did this happen, can you reproduce the problem yourself? Exact DP version number? Did you try breaking clay? Clay had an issue with config causing an error we already fixed.
     
  13. Offline

    RugRats

    Lol! Questions Umm it was from a player not me maybe it was clay I have no idea :D 1.3 Dev 2 the newest one If it was clay you didn't fix it :p
     
  14. Offline

    Juze

    Could you test it? Spawn clay and break it, see if you get an error. If it does, I'll post you an updated jar.

    Also, v1.3 will be changed to v2.0, v1.2.4 will be changed to v1.3 and all that weird stuff. Yeah, I surely messed up everything with version numbering and have to deal with the version number mess!
     
    RugRats likes this.
  15. Offline

    RugRats

    Lol man I love plugin developers that are like you so fast to reply and very hyperactive LOL I'll test -Rug Out!

    I have multiverse and I have a PVP world I see the config has world and world_nether do I just add the worldname and then put the config in it so it will work with my third world if that makes sense :D

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

    Juze

    Nope, that did not make much of sense for me. :D The plugin should generate the config for you. v1.3 or so called v2.0 will be released in few days, hopefully.
     
  17. Offline

    RugRats

    Okay the zip comes with 2 configs the one for world and world_nether. The 2 worldsany regular server has. I have multiverse so i have more then one world I have 3. So if I want to have custom drops on that third world do i just have to make a file in the dropplugins folder called PVP which is my third worlds name then just copy and paste a config over into it and it should work?
     
  18. Offline

    Juze

    Yes. The plugin *should* create a config automatically for your PVP world, but if it doesn't, I'll look into it.
     
  19. Offline

    RugRats

    I tested my normal config and didn't get any errors.
    drop:
    glass: true
    stairs: true
    bookshelf: true
    glowstone: true
    snowblock: true
    boat: true
    clay: false
    cake: false
    snowtile: false
    wood: false
    ores: false
    grass: false
    stone: false
    mobspawner: false
    leaves: false
    ingots: false
    ice: false
    flint: false
    doublesteps: true
    I tested everything with true. I'll now test everything else. Also it does not auto reload the config I have to either reload in the console or restart and /drops reload doesn't work.

    It doesn't :/

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

    Juze

    Are you sure you are using v1.3-dev2?

    Okay, ran MultiVerse on my test server, it did NOT create a config for world named "PVP". Thanks for the bug report! @ChrizC

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

    RugRats

    Yes I am unless that download is a different one I'm pretty sure it's 1.3dev2 I triple checked :D and your welcome.

    Okay i put everything as true and will now test :D i'll tell you the result in a minute :D
    @Juze Tested everything no errors! must of been a problem with this and multiverse because my players were in the third world when the error came up. I tested this all in "world" which is my normal world :D

    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 already did, still errors. MultiVerse doesn't seem to be supported yet. I'll get you back on that. Need WorldLoadEvent... @ChrizC
     
  23. Offline

    RugRats

    Yes i editted that with the result :D
     
  24. Offline

    Juze

    Tested again, no errors now... still need to manually add the config until we get a fix out @ChrizC :) Thanks for heads up again!
     
  25. Offline

    RugRats

    np!

    @Juze

    I manually added a file called PVP my third worldname and pasted a config in there(The one from the file called world my first world name) This is my config.

    Code:
    drop:
        glass: true
        stairs: true
        bookshelf: true
        glowstone: true
        snowblock: false
        boat: true
        clay: false
        cake: false
        snowtile: false
        wood: false
        ores: false
        grass: false
        stone: false
        mobspawner: false
        leaves: false
        ingots: false
        ice: false
        flint: false
        doublesteps: true
    
    I get this error for everything in the PVP world true or false.

    Code:
    2011-06-22 03:58:00 [SEVERE] Could not pass event BLOCK_BREAK to DropPlugin
    java.lang.NullPointerException
        at me.juze.DropPlugin.DPBlockListener.onBlockBreak(DPBlockListener.java:190)
        at org.bukkit.plugin.java.JavaPluginLoader$35.execute(JavaPluginLoader.java:482)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:159)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:456)
        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:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    I posted this to be sure your getting the same error :D

    CB860 1.3 dev 2

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

    ChrizC

    It does not auto reload the config if you edit it by hand, this is obvious.
    If you use a command ingame (/dropplugin enable Clay world), it will auto-reload the config.

    Chris
     
  27. Offline

    Juze

    Already known, I seemed to fix it with /drops enable glass PVP... Will look into it.
     
  28. Offline

    ChrizC

    Did you create this world AFTER you installed DropPlugin?

    Chris
     
  29. Offline

    Juze

    Nope, before. Let me try again...

    EDIT: You see, the problem is that our code doesn't generate a config for world "PVP" automatically. If you create that manually, it works just fine, no problems with that. Focus on the problem.
     
  30. Offline

    ChrizC

    How does MultiVerse handle worlds? The code is supposed to get all worlds on the server, hence Bukkit.getServer().getWorlds();... very odd.

    Chris
     
  31. Offline

    RugRats

    If you create it manually i get an error for world PVP and just in that world :D
     

Share This Page