[INACTIVE][MECH] OtherBlocks v0.7.4 - Customize drops in combo with everything else [617]

Discussion in 'Inactive/Unsupported Plugins' started by cyklo, Feb 11, 2011.

  1. Offline

    cyklo

    OtherBlocks - Customize what broken blocks and dead mobs drop!
    Version: 0.7.4
    Download: Jar File | Source Code
    Like this plugin? [​IMG]

    Main author: @cyklo
    Contributors: @Celtic Minstrel

    See the Wiki page for full details on how to set up OtherBlocks

    If you are getting errors with the word "snakeyaml" in it, your config file isn't properly formatted.
    Test it on this website.


    OtherBlocks is a plugin that lets you apply rules to what blocks drop when destroyed, depending on what tool you used. It is inspired by decino's goldenNether plugin.

    You can set rules in the configuration file to match any item with any block and give it a different drop item. For example, you could allow gathering of Glowstone Dust on the overworld by breaking Redstone ore with a golden pickaxe. Or you could allow ingots to be mined directly from their ores if you use Flint and Steel. Or you could invoke Isaiah Mustafa and decree "THE LEAVES ARE NOW DIAMONDS!"

    To install, simply decompress the contents to your plugins directory. Then, copy otherblocks/config.sample.yml to otherblocks/config.yml and edit away!

    Don't forget - to see how to edit the config file, check out out the Wiki!



    Changelog (open)

    Version 0.7
    • Added new drop types DEFAULT and NOTHING (0.7.4)
    • Fixed: creature drops don't work in specific worlds (0.7.4)
    • Added new mob types: CREATURE_GIANT, CREATURE_MONSTER, CREATURE_WOLF (0.7.3)
    • Will no longer throw problems with new types of mob when out of date (0.7.3)
    • Can specify creatures as the tool of death for mobs (0.7.2)
    • Can specify damage events as the tool of death for mobs (0.7.2)
    • Can specify data (colour) values for when you kill a sheep (0.7.2)
    • Fixed: doesn't work on CB 561+ (0.7.2)
    • Can specify data values for SPECIAL_LEAFDECAY events (0.7.2)
    • Large internal changes (0.7.2)
    • Fixed: number of spawned mobs did not obey config file (0.7.1)
    • Fixed: NullPointerException on mob item drop (0.7.1)
    • "color:" works for more than just wool and dyes, now works for wood, half-height blocks, crops etc. (0.7)
    • Synonyms, allowing you to specify groups such as "ANY_REDSTONE_ORE" and "ANY_PICKAXE" (0.7)
    • Can now specify data value of blocks you are dropping from, e.g. "CROPS@RIPE" (0.7)
    • Can now drop a number of items in a range (0.7) (by Celtic Minstrel)
    • Can now drop "CONTENTS" of containers, e.g. dispensers, furnaces (0.7) (by Celtic Minstrel)
    Version 0.6
    • Added SPECIAL_LEAFDECAY tag. See the wiki. (0.6.2)
    • Back-end changes to build process (0.6.1)
    • Multiworld support! Now you can customize drops on a per-world basis (0.6)
    Version 0.5

    • Now you can change what a mob drops when it is killed by a player! (0.5)
    Version 0.4

    • Fixed the map-break AIR bug (0.4.6)
    • Now specify multiple tools at the same time with syntax [TOOL_A, TOOL_B] (0.4.5)
    • Fixed incorrect colours of dropped dyes (0.4.4)
    • Added "ANY" as synonym for "ALL" (0.4.4)
    • Adjustable priority (0.4.3)
    • Can hide boot messages with "verbosity: low" (0.4.2)
    • Quantity and Damage bugfixes, works with Beta 1.3 (0.4.1)
    • Oh god, now you can spawn creepers (and other mobs) (0.4)
    • Fractional percentage chances such as 0.01% are valid (0.4)
    Version 0.3

    • Conforms to new plugin standards and breaks backwards compatibility (0.3)
    Version 0.2

    • Can now drop multiple items per block (0.2.5)
    • Fixed bug introduced in 0.2.3 (0.2.4)
    • Can now specify color of dropped item for wools and dyes (0.2.3)
    • Once again (and hopefully for the last time) fixed durabilities (0.2.2)
    • Changed to lowest priority, hopefully for better compatibility (0.2.2)
    • Fixed durability bug (0.2.1)
    • Change to config.yml format (0.2)
    • Can now specify multiple drops per block, based on different tools (0.2)
    Version 0.1


    • Added "ALL" selector for tools (0.1.3)
    • Workaround for bug in Bukkit whereby durability and max stack size are mixed up (0.1.3)
    • Added drop probability (0.1.2)
    • Customizable damage on block destruction (0.1.1)
    • First release (0.1)
     
    Steve Cole, g_BonE and tension69 like this.
  2. Offline

    Taxen0

    hello! this seems like a really useful mod. but here is my question!
    Will the code:

    Code:
    MOB_SPAWNER@CREATURE_SKELETON:
    
        - tool: GOLD_SWORD
    
        drop: MOB_SPAWNER@CREATURE_SKELETON
    
        chance: 100
    
        - tool: ANY_SWORD
    
        drop: MOB_SPAWNER@CREATURE_PIG
    
        chance: 100
    Make a skeleton-spawner drop a skeleton-spawner if you use a golden sword, and a pig-spawner if any other sword is used? or will it drop both spawners if a gold sword is used? or dosnt this work with mob spawners at all?

    thanks!
     
  3. Offline

    cyklo

    Just uploaded 0.7.1, which fixes this. Also fixes the problem whereby if you set multiple mobs to spawn, they didn't.
    No, and unlikely to fully. Specifying the drops for a certain type of mob spawner is technically possible, but not currently implemented as it's not like the data value with e.g. wool blocks.

    Setting the mob type of a dropped mob spawner is impossible at the "picking up the block" stage. You'd need a plugin such as creaturebox to set what mob a mob spawner produces once laid.
     
  4. Offline

    Taxen0

    Ok that's a shame. I guess I can make the spawner drop a default spawner atleast. that should spawn pigs when placed right? or doesn't it spawn anything until specified by another plugin?
     
  5. Offline

    cyklo

    Yes, by default a mob spawner will spawn pigs. Basically think of it the same way as a sign - when you break a sign and then put it down somewhere else, it doesn't keep the message.
     
  6. Offline

    Celtic Minstrel

    Support for that is in the pull request; it just needs additional support in Common for it to work. Though I didn't test it.

    It is actually possible to specify what type of mob a dropped spawner will spawn when placed if you have creaturebox installed. I posted in the creaturebox thread on this topic. It won't work if you don't have creaturebox, though.
     
  7. Offline

    cyklo

    Didn't see it in the pull request, so I have added it - required some bit twiddling due to 0x4 indicating "decayed". If you mean falling back to default numerical values if Enum tests fail, then I shall add it to Common right now.
     
  8. Offline

    Avous

    [SEVERE] Could not load plugins\otherblocks.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:159)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:107)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: mapping values are not allowed here
    in "<reader>", line 5, column 19:
    CREATURE_CHICKEN:
    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:745)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:307)
    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.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:149)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:111)
    ... 8 more

    what am i doing wrong with my config? here it is http://pastebin.com/3w0SQuuD
     
  9. Offline

    Celtic Minstrel

    Well, in the pull request I put a check for data in the leaf decay handler, but it was just a duplicate of the one in the block break handler. I was going to say you could just add "case SPECIAL_LEAFDECAY" to the function in Common that turns data into a number, but I just now realized that that would probably not work since it's not a Material.* constant. Still, that's basically what needed to be done as far as I was aware. I may have missed some detail that was needed.

    @Avous - Try deleting the blank line before CREATURE_CHICKEN (or adding spaces so that it matches the indentation level of CREATURE_CHICKEN. I'm not sure if that's the problem, but it's the first thing I thought of when I saw your config.
     
  10. Offline

    Avous

    the first thing i tried was no blank line but i still got the same error.
     
  11. Offline

    cyklo

    Oddly, I do not get the same error as you. Nonetheless, you do not have enough spaces in front of CREATURE_COW. Must be at least 2.

    Edit: this page cleans up any errors in config files. Uncheck "canonical" and set "Default flow style" to "Block style". http://instantyaml.appspot.com/
     
  12. Offline

    Celtic Minstrel

    Huh, no idea then. I notice that CREATURE_COW seems to be indented by one space instead of two, but that's after CREATURE_CHICKEN so it seems unlikely that that's the problem...
     
  13. Offline

    Avous

    ... and now it works fine after i put the other space in front of cow XD lol you guys are boss at this id never of noticed i missed a space on COW in 150 lines of 2349 text lol took forever to edit it too ~_~ trying to go for a improved survival vibe
     
  14. Offline

    driftgoat

    Have you got a change log that you could put up please cyklo. just so everybody has a fair idea what's been updated. I haven't been able to keep up with the posts.
     
  15. Offline

    cyklo

    There's one in the first post, always has been.
     
  16. Offline

    driftgoat

    My bad, had no idea it was there, just noticed when you mentioned it. Sorry
     
  17. Offline

    Taxen0

    Thanks for the help! it works close to perfect now.
    However creaturebox drops a spawner with all tools etc, but I want it to work with golden swords only, and other swords should drop a pig-spawner. so this is my idea of how the config should be:
    Code:
        MOB_SPAWNER:
             - tool: [WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD]
               drop: MOB_SPAWNER
               chance: 100
             - tool: GOLD_SWORD
             //something to make it drop default ("ignore" gold swords)
             - tool: ALL
               drop: AIR
               chance: 100
    Any idea on how to solve the gold sword part?
    I tried making it drop air with 0% (so it always gets the default drop) but it seems that creaturebox wont register the drop.. or something.

    also an other question that might be a little off topic, is there a way to make monsterspawners "un-stackable"? it seems creaturebox distinguishes different spawners by durability, and if I have lets say a zombie spawner and a pig spawner, and places the pigspawner on the zombie one. it now counts as 2 zombiespawners.
     
  18. Offline

    Celtic Minstrel

    Not sure. Best way would probably to give no-one the creaturebox permission that allows them to mine spawners, and then have OtherBlocks handle the mining of spawners (you shouldn't need the ALL tools section then).

    Huh, that one's odd. I thought Minecraft never allowed items with different durability to stack. I don't think that's fixable at this time. Well, possible with hacking into Minecraft code, but no guarantees there; anyway, that would be something to discuss with Lodran.
     
  19. Offline

    Taxen0

    Not sure I follow you, if I don't give mining permissions to anyone will the "state"(monster) of the mob-spawner be saved? or is there a way to use creaturebox through otherblocks?
     
  20. Offline

    Celtic Minstrel

    This, sort of. You can specify what type of mob spawner creaturebox will create when placing the spawner by using the "color:" field in OtherBlocks. For example, "color: 1" would be... I think a chicken spawner (might be cow, can't quite remember)? You do need to have creaturebox installed for this to work (otherwise all placed spawners will spawn pigs), though.

    Unfortunately, you can't use OtherBlocks to make mined mob spawners drop the same type of spawner, because OtherBlocks does not know what kind of mob the spawner spawns. Perhaps you should ask Lodran to implement an optional tool requirement on the mining of mob spawners.
     
  21. Offline

    Taxen0

    would it be possible to implement a "except" line in otherblocks?
    example:
    Code:
    LEAVES:
         - tool: ANY_HOE
           drop: APPLE
           chance: 50
           except: WOOD_HOE
    And in this case ignore things done to leaves with a wooden hoe, and give the regular drop.
    that way you don't have to remember/update default drops as they may change in the future.
    also my problem would likely dissapear =P

    I would rather config it myself using your plugin, sense I find it very easy and effective to use.
     
  22. Offline

    Celtic Minstrel

    I recall suggesting something like that, though I didn't have an idea of how to specify it as you do. With the way you suggest, we'd probably want to make "tool:" optional and default to "ANY".
     
  23. Offline

    Taxen0

    yes, tool: ANY as default, if not specified. Sounds like a good idea
     
  24. Offline

    cyklo

    Right, it appears I've been away for a day and Celtic Minstrel has been fielding questions. Trying to understand this problem:

    So trying to think how this would work without adding too much complexity. The whole "not always overriding the default drop thing" has annoyed me for a while, a bad design decision made early on. I propose the following new syntax:

    Code:
        MOB_SPAWNER:
          - tool: ANY
            flags: [DEFAULT_NEVER]
    
          - tool: [WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD]
            drop: MOB_SPAWNER
    
          - tool: GOLD_SWORD
            flags: [DEFAULT_ALWAYS]
    
    A flags section which can contain a selection of toggleable settings. For now to start with, just a DEFAULT_ALWAYS and DEFAULT_NEVER to override OtherBlocks' sometimes unpredictable and annoying behaviour when it comes to default drops. Also would negate the need for the unintuitive "air/100" thing.
     
  25. Offline

    Taxen0

    This looks good! and if it works as intended would make things more intuitive and solve my problem.
    As long as it works by not doing anything with the DEFAULT_ALWAYS flag, and not dropping the default item from a hardcoded list.
     
  26. Offline

    cyklo

    Plan breakdown:
    - DEFAULT_ALWAYS - allows the block to break as it normally would, the extra drops are just "in addition"
    - DEFAULT_NEVER - eliminates the need to do a separate AIR/100 definition.
     
  27. Offline

    xGONExCRAZYx

    I made leaves drop cocoa (brown dye) when destroyed with a gold axe, but when I load the server it says the drop is changed to ink sacks...?

    Code:
        LEAVES:
            - tool: ALL
              drop: AIR
              chance: 100
            - tool: ALL
              drop: SAPLING
              chance: 15
            - tool: GOLD_AXE
              drop: APPLE
              chance: 80
            - tool: GOLD_AXE
              drop: GOLDEN_APPLE
              chance: 15
            - tool: GOLD_AXE
              drop: WOOL
              color: BROWN
              chance: 50
    
    Code:
    2011-03-26 12:05:37 [INFO] OtherBlocks: ALL TOOLS + LEAVES now drops AIR
    2011-03-26 12:05:37 [INFO] OtherBlocks: ALL TOOLS + LEAVES now drops SAPLING with 15.0% chance
    2011-03-26 12:05:37 [INFO] OtherBlocks: GOLD_AXE + LEAVES now drops APPLE with 80.0% chance
    2011-03-26 12:05:37 [INFO] OtherBlocks: GOLD_AXE + LEAVES now drops GOLDEN_APPLE with 15.0% chance
    2011-03-26 12:05:37 [INFO] OtherBlocks: GOLD_AXE + LEAVES now drops INK_SACK with 50.0% chance
    
     
  28. Offline

    cyklo

    Dye is a word I made up. Internally minecraft calls them ink sacks (after what squids drop).
     
  29. Offline

    xGONExCRAZYx

    So how do I make it drop actual dye?

    EDIT: Does it actually drop brown dye, but just calls it ink sacks on the server?
     
  30. Offline

    Celtic Minstrel

    Yes.


    Though that config you posted is dropping brown wool instead. :p
     
  31. Offline

    AgentFedora

    I need Help! After i edit the config.yml file i get these errors on my server:
    Code:
    13:40:24 [SEVERE] Could not load plugins/otherblocks.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:159)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:107)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:105)
        ... 8 more
    
     

Share This Page