[INACTIVE][ADMIN/GEN] DropEdit v1.4.4 - Get different drops when destroying blocks [818]

Discussion in 'Inactive/Unsupported Plugins' started by NuxlyStardust, Apr 1, 2011.

  1. Offline

    NuxlyStardust

    DropEdit - Get different drops when destroying blocks
    Version: v1.4.4 (05/21/2011)
    Tested on: 798


    This is my first plugin. It allows you to define what your players get when
    they destroy certain types of blocks with a given tool.

    A good use for it is to allow your players to get sponge or nether blocks
    without having to use portals.

    This plugin was inspired by Jerry's NetherBlocks. I wanted the ability to
    add more blocks without having to edit the code every time. If you only want to use blocks from the Nether on a server where it can't be accessed, I recommend you to use his plugin instead, which will be more lightweight as its use is more specific.

    I would like to thank sk89q for his help, and all of you for your support and for reporting bugs.

    Features:
    • Make anything drop from broken or burned blocks, or decaying leaves.
    • A random number of items can be dropped.
    • You can define what percentage of chance players have to get a certain item.
    • Support for wool color and dye type.
    • Support for Permissions.
    • Support for CraftbukkitUpToDate.
    • Compatible with WorldGuard.
    How to configure:
    All details are given on the Wiki. A sample config file is joined with the plugin.

    Example:
    Code:
    items:
        GlowstoneDust:
            id: 348
            min: 1
            max: 3
            chance : 100
            groups:
                - *
    
    break:
        '2':
            '284':
                - GlowstoneDust
    With this setup, if you destroy (break) a grass ('2') block with a
    gold shovel ('284'), you will always (chance: 100) get
    1 to 3 (min: 1; max: 3) of glowstone dust (id: 348).

    For each item, only the "id" key is required, all other are optionals.

    Event
    The event here is "break". You can also use "burn", and "decay". These last two don't require a tool, so the list of items must appear in the block's section.

    Event > Block
    The block here is '2'. You can set it to '*', to refer to any block.
    You can also restrict the event to certain damage value by separating the two values with a comma. For example, '35,11' is a blue wool block.

    Event > Tool
    If you set the tool to * (or '*', both will work), the specified item will be dropped regardless of the tool used to destroy the block.
    Just like with the block, you can set a damage value.

    Item > Durability
    "durability" is optional (Default: 1). It allows you to select the wool color of type of dye
    you want.

    Item > Groups
    "groups" is optional (Default: '*'). It allows to define custom drops that will apply only for given groups. You need the Permissions plugin for that. This feature has been tested on Permissions 2.5.5.
    If Permissions is not installed, this field will be ignored.
    A list is expected, so you should use the list notation (as showed in the example above) even if you want to specify only one group.

    Item > Message
    "message" is optional (Default: none). It allows you to define a message that will be sent to the player. I strongly recommend that you use it only for very rare items, and only for the "break" event. Otherwise, the chat will overflow with messages from the plugin.

    Download:
    Important: The configuration file structure has changed in v1.4.0, do not forget to update your config.yml file.

    Latest version - Source Code - Wiki
    Old versions: 1.4.3 - 1.4.2 - 1.4.1 - 1.4.0 - 1.3 - 1.2 - 1.1

    Permissions Plugin

    Getting help & reporting problems:
    I 'll be glad to help you if you're having difficulties using my plugin, just post your questions in this thread.
    I will be able to help you faster if you provide the following:
    • A precise description of your problem, and explanations on what you are trying to do.
    • Your config file (if it is too long to post here, use codepaste.net).
    • A quick list of the other plugins you are using. Certain problems can be caused by conflicts between plugins.
    • Any particular output of my plugin visible in the logs (exceptions or other messages).
    Before you post, make sure that you are using the latest version of my plugin. The most recent version is indicated at the top of this post. I can't offer support for old versions. Also check that you are using the Bukkit's latest recommended build.

    Known Issues:
    • You will not always get items from burning blocks because they may be destroyed by the fire.
    • Exceptions will be thrown if the Permissions config file doesn't contain any group. This is a problem in the Permissions plugin, I can't do anything about it.
    • You can't use it to get spawners when you break them. If you need to work with spawners, I suggest CreatureBox.
    Todo:
    I can't tell for sure when the next version will be available.
    • iConomy support
    Information for developers:
    Used events: BLOCK_BREAK (High), BLOCK_BURN (High), LEAVES_DECAY (High)
    This plugin will not cancel any event.
    You can simulate any of these events using the appropriate methods in the plugin class (breakBlock, burnBlock, blockDecays).

    Changelog:
    Version 1.4.4 (05/21/2011)
    • Added "message" parameter, be careful with it (Requested by m5k).
    Version 1.4.3 (05/05/2011)
    • Fixed potential compatibility problem with the next versions of WorldGuard (thanks to sk89q)
    • Added methods to the main plugin class to allow other plugins to interact with DropEdit.
    Version 1.4.2 (05/02/2011)
    • Fixed compatibility problems with WorldGuard (Reported by JacKlink01).
    • Fixed potential compatibility problems with other plugins, Residence is likely working now.
    Version 1.4.1 (04/27/2011)
    • Fixed a bug that caused the Minecraft client to crash if the config file contained invalid YAML syntax. Yes, really.
    • Works with 733.
    Version 1.4.0 (04/24/2011)
    • Changed config file structure.
    • Added leaves decay event.
    • Added ability to restrict blocks and tools to a certain damage value.
    • Added support for CraftbukkitUpToDate (will be ready soon).
    • Added properly working way to make multiple items drop for the same event.
    • Tested on 684. Works.
    • Created a Wiki: https://github.com/NuxlyStardust/DropEdit/wiki
    Version 1.3.4 (04/14/2011)
    • Updated for 677.
    Version 1.3.3 (04/12/2011)
    • Fixed a bug that prevented the plugin from dropping multiple items of the same type.
    Version 1.3.2 (04/09/2011)
    • Fixed a bug that caused undefined blocks not to drop anything. (Reported by DjinnRutger)
    Version 1.3.1 (04/08/2011)
    • Fixed a bug that caused the iron hoe not to get damage when used to break blocks.
    • Fixed a bug that prevented the plugin from dropping multiple different items.
    • The config file structure has changed ! Make sure to update your file. This structure is temporary and will be replaced by a more tidy one in the next version.
    Version 1.3.0 (04/05/2011)
    • Added ability to make block drops a certain item regardless of the tool used. (Idea by Andrew0085)
    • Added ability to restrict drops to more than one group. (Requested by Andrew0085 and SpyDaniel)
      • Replaced "group" by "groups" in the configuration, do not forget to update your file !
    Version 1.2.1 (04/03/2011)
    • Fixed a bug that caused hoes to be unbreakable. (Reported by Leemur)
    Version 1.2.0 (04/03/2011)
    • Added ability to restrict drops to certain groups. Uses the Permissions plugin.
    Version 1.1.0 (04/02/2011)
    • Added ability to select what item is dropped when a block is destroyed by fire.
    • Added support for dyes/wool color.
    Version 1.0.1 (04/02/2011)
    • Renamed project to DropEdit.
    Version 1.0.0 (04/01/2011)
    • First build.
    _______________________________
    [​IMG] - Thanks a lot for your support !
     
  2. idk i would assume it would be something like /dropedit <block> <drop> Ex. /dropedit wood log and it would change wood so when you break it it would drop logs instead.
     
  3. Offline

    NuxlyStardust

    Honestly I don't think it'd be good. Cause you'd also need a command to edit and delete entries, and thus a command to list them. It would be a real mess.
     
  4. Offline

    ZafireCondor

    I've tried to make it where when you destroyed a normal log with an ink sack it would drop a dark wood log, but i can't get it to work. Can someone show me what code to use?
     
  5. Offline

    NuxlyStardust

    It's not currently possible to tell what specific dye breaks a block, I'll add this feature once I'm done working on a different plugin :)
     
  6. if you don't already have a new config style ideea, here's a quick ideea:
    Code:
    itemid or ITEM_NAME + toolid:tooldmg
     = dropitemid:dmgval, chance%, min-max, groups, unique material as true or false
     = 66, 25%, 1-1, *
     = 5, 100%, 1-1, _, true
    
    anothertool + toolid:tooldmg
     = drop... etc
    
    ITEM_NAME meaning the item names used by /give and other plugins.
    You could also add _ for skipping params.
    unique material meaning if that gets dropped, it should ignore the others.
    Also don't mind the front spaces, read everything, single spaces, tabs ,everything... the new line at the end should be the splitter tough.
    You could also add damage range for tools, for example:
    GOLD_AXE:75-100 = only 75%+ gold axes may work.

    But anyway, I'm strugling to make it work atm :/
     
  7. Offline

    NuxlyStardust

    Hey, thanks for your help but I'll stick with yaml for ease of use, I have a new structure in mind ;)
     
  8. Offline

    cholo71796

    This is one of the best plugins out there, but is there a way to make it so if it doesn't drop X it drops Y?
     
  9. Offline

    NuxlyStardust

    Not currently, I will add more features after the release of the next version. I started to work on it today :)
     
  10. Offline

    cholo71796

    Nice to know! I'm hoping to have it so one of my factions picks up smooth stone 1/2 of the time and cobblestone 1/2 of the time from mining stone.
     
  11. Offline

    NuxlyStardust

    Well you can do that by setting the chance to 50% for both items, but sometimes it might drop both or none.
     
  12. Offline

    cholo71796

    Yeah, exactly, I want it so it makes sense :D
     
  13. Offline

    NuxlyStardust

    ...and manufacturing sense takes time :p
     
    cholo71796 likes this.
  14. Offline

    Maguron

  15. Offline

    NuxlyStardust

    You have two drops blocks, so only the last one will be seen by the parser. Remove the second "drops:" and it will work :)
     
  16. Offline

    Maguron

    Oh i´ll test it
    one mom.
     
  17. Offline

    Tealk

    its possible to list groups?
    '18':
    '271':
    '351':
    groups:
    - Forster
    - Forsterprem
    durability: 3
    chance: 5
     
  18. Offline

    NuxlyStardust

    To list groups? What exactly are you trying to do?
     
  19. Offline

    Tealk

    that 2 groups are allow to become this drop

    2011-04-21 17:12:12 [SEVERE] Could not load 'plugins/DropEdit.jar' in folder 'plugins':
    while scanning for the next token
    found character '\t' that cannot start any token
    in "<reader>", line 14, column 26:
    chance: 2
    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:360)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:183)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:564)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
    at org.bukkit.util.config.Configuration.load(Configuration.java:73)
    at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:158)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:138)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:160)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:108)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:84)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
     
  20. Offline

    NuxlyStardust

    Well this is a problem with the yaml parser, you config file is broken.

    Code:
    '18':
             '271':
                 '351':
    This is where the problem is, you can't have empty sections.
     
  21. Offline

    Tealk

    i write it with notepad
    and there i dont have it what should i do?

    it looks like so now
    http://pastebin.com/xFZYwipP

    Code:
    2011-04-21 19:15:50 [SEVERE] Could not load 'plugins/DropEdit.jar' in folder 'plugins':
    while scanning for the next token
    found character     '\t' that cannot start any token
     in "<reader>", line 12, column 26:
                        chance: 2
                                 ^
    
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:360)
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:183)
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:564)
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
        at org.bukkit.util.config.Configuration.load(Configuration.java:73)
        at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:158)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:138)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:158)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:106)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:84)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  22. Offline

    NuxlyStardust

    As you can see it reports an error at line #12 after "chance: 2". The problem is that there are whitespaces after the data. Remove those spaces and it will work. I see in your file that some other lines have this problem.
     
  23. Offline

    Tealk

    and how i know that the space is ok?
    because notepad say its the same space
     
  24. Offline

    NuxlyStardust

    I mean after the data.
    Code:
    "chance: 2                        "
                          ^^^^^
                      many spaces here
    
    You gotta remove them, there are other lines in your config file that have the same problem.
     
  25. Offline

    Tealk

    ok thanks
     
  26. Offline

    NuxlyStardust

    You're welcome, let me know if you need anything else :)
     
  27. Offline

    goldfinch

    Freaking epic plugin dude, my users have wanted a way to get things like sponge and leaves for a while now. Great work. Works completely without problem for me, so I've got nothing else to say!
     
  28. Offline

    NuxlyStardust

    Thanks a lot for your comment, glad you like it :)
     
  29. Offline

    Tealk

    a question, will dropedit overwrite the normal drops?

    '292':
    '296':
    min: 2
    max: 5
    chance: 3

    i only get now Wheat and no Seeds
     
  30. Offline

    NuxlyStardust

    Yes, you need to add an entry for seeds.
     
  31. Offline

    Tealk

    hmm ok
     

Share This Page