[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

    Celtic Minstrel

    Did you even try it on 1.4? I know it loads perfectly fine on CraftBukkit 617, though admittedly I haven't actually tried breaking any blocks yet.
     
  3. Offline

    Ratte

    it works on 1.4 with newest bukkit. (only tested blocks, but mobs should work too)
     
  4. Offline

    Celtic Minstrel

    Actually, I got an error with mobs.
    Code:
    2011-04-01 14:30:37 [SEVERE] Could not pass event ENTITY_DEATH to OtherBlocks
    java.lang.NullPointerException
    	at com.sargant.bukkit.otherblocks.OtherBlocksEntityListener.onEntityDeath(OtherBlocksEntityListener.java:102)
    	at org.bukkit.plugin.java.JavaPluginLoader$39.execute(JavaPluginLoader.java:405)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    	at net.minecraft.server.EntityLiving.p(EntityLiving.java:466)
    	at net.minecraft.server.EntityLiving.a(EntityLiving.java:445)
    	at net.minecraft.server.EntityLiving.a(EntityLiving.java:393)
    	at net.minecraft.server.EntityMonster.a(EntityMonster.java:47)
    	at net.minecraft.server.EntityWolf.a(SourceFile:382)
    	at net.minecraft.server.EntityCreature.c_(EntityCreature.java:68)
    	at net.minecraft.server.EntityWolf.c_(SourceFile:129)
    	at net.minecraft.server.EntityLiving.r(EntityLiving.java:653)
    	at net.minecraft.server.EntityWolf.r(SourceFile:164)
    	at net.minecraft.server.EntityLiving.f_(EntityLiving.java:231)
    	at net.minecraft.server.EntityWolf.f_(SourceFile:194)
    	at net.minecraft.server.World.a(World.java:983)
    	at net.minecraft.server.WorldServer.a(WorldServer.java:52)
    	at net.minecraft.server.World.f(World.java:965)
    	at net.minecraft.server.World.e(World.java:942)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:365)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    It doesn't happen every time a mob dies though, so it might not prevent mobs from working in general.
     
  5. Offline

    cyklo

    EntityWolf related - it's not recognising wolf deaths. Needs a NullPointerException catch for unrecognised mob types.

    Just uploaded 0.7.3. Changes:
    • New mob types: CREATURE_GIANT, CREATURE_MONSTER and CREATURE_WOLF
    • Will no longer throw a wobbler when an unrecognised mob types dies.
    Doing all this over 3G on a train...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  6. Offline

    derfernet

    Everything is working fine for me except an odd issue with creatures and Multiworld support. When dealing with regular blocks everything works fine: I can make a glowstone block drop dust in one world and drop blocks in another world. But when I try to apply this to creatures things break down.

    The Creature drops themselves work fine; for example I can make a sheep drop glowstone when killed in all worlds if I leave out the world settings line. But when I specify a world in the settings like I do for regular blocks, the drops don't happen, not only in the specified world but in any world.

    I'm using the latest version of OtherBlocks (0.7.3) and CraftBukkit version 617. No errors appear in the console.
     
  7. Offline

    Ratte

    Is there any chance the Wiki gets updated? There are several things listed in the Changelog which i don't know how to use properly:

     
  8. Offline

    cyklo

    I've updated the wiki for a bit more clarity, but it may not answer your exact questions. If there's anything I'm missing or unclear about, please let me know.
     
    Ratte likes this.
  9. Offline

    Taxen0

    I think you forgot about flags
    That's all I could think of, Nice work!
     
  10. Offline

    cyklo

    Not implemented flags yet, got an hour of battery left on this laptop so will work on it now!
     
  11. Offline

    Taxen0

    also a list of DAMAGE_TYPES and a description on what they do would be nice. and do you know if its at all possible to add a "DAMAGE_WATER" (as in "destroyed by" water) type?
    that could trigger when water destroy crops / torches / redstone and such.
     
  12. Offline

    cyklo

    Huh. Just tested it and you are right. I've just patched it and it will be fixed in 0.7.4.
     
  13. Offline

    Avous

    question (because i was getting 1% drops every kill) if you dont add air to drops will it keep running chances until a item drops? because when i used the plugin i dont think i ever killed something and not had something drop.
     
  14. Offline

    cyklo

    If you don't add AIR/100 and the probability check for your custom item fails, the block's regular drop will happen instead. AIR/100 stops the default drop.
     
  15. Offline

    Avous

    OH thats probably why i was getting drops every time haha... i had all the items dropping off of creatures that normally dropped and added a creature spawner to them because i thought it would overwrite any drops i put in the plugin like if i put cows to drop bones and left out leather then id never see any leather
     
  16. Offline

    derfernet

    Fantastic
    Everything else is working great. It really adds something when each world acts differently with its drops.
     
  17. Offline

    Shay Williams

    Uhm. Could you give us a list of all possible damage events you could enter as the "tool"?

    EDIT: NVM, found it!

    CONTACT Damage caused when an entity contacts a block such as a Cactus.
    Damage: 1 (Cactus)
    ENTITY_ATTACK Damage caused when an entity attacks another entity.
    Damage: variable
    SUFFOCATION Damage caused when an entity falls a distance greater than 3 blocks.
    Damage: fall height - 3.0
    FALL Damage caused by being put in a block.
    Damage: 1
    FIRE Damage caused by direct exposure to fire.
    Damage: 1
    FIRE_TICK Damage caused due to burns caused by fire.
    Damage: 1
    LAVA Damage caused by direct exposure to lava.
    Damage: 4
    DROWNING Damage caused by running out of air while in water.
    Damage: 2
    BLOCK_EXPLOSION Damage caused by being in the area when a block explodes.
    Damage: variable
    ENTITY_EXPLOSION Damage caused by being in the area when an entity, such as a Creeper, explodes.
    Damage: variable
    VOID Damage caused by falling into the void.
    Damage: 4 for players
    CUSTOM Custom damage.
    Damage: variable
     
  18. Offline

    cyklo

    See the wiki:
    https://github.com/cyklo/Bukkit-OtherBlocks/wiki/Material-and-Creature-Values

    Note they are not exactly the same as the damage values built in to Bukkit - e.g. FIRE, FIRE_TICK and LAVA are all covered by DAMAGE_FIRE. You also can't set VOID because it doesn't make sense.
     
  19. Offline

    Celtic Minstrel

    I second this, but I'm not sure if Bukkit has an event for it.

    I thought you added the "flags:" field for that. Speaking of which, maybe you could add another flag to stop the plugin from looping through the various options if the given drop occurs? Something like this:
    Code:
    otherblocks:
      STONE:
        - tool: DIAMOND_PICKAXE
          drop: STONE
        - tool: DIAMOND_PICKAXE
          drop: COAL
          chance: 0.1
          flags: [BREAK]
        - tool: DIAMOND_PICKAXE
          drop: DIAMOND
          chance: 0.01
    So basically, if coal drops, you'll never get diamond. I would suggest using a name other than BREAK though; I only used that because it corresponds to what you'd do in the code and I couldn't think of a better name.

    Also, I'm assuming you're adding support for minecarts and boats now that there's a VEHICLE_DESTROY event; you should include ANY_MINECART as well as CONTENTS support for the engine and freight cart. Also, CONTENTS support for jukeboxes might be nice (use getData().getPlaying() for that, I think). :)

    Not quite; a few of those are not available (FIRE_TICK and VOID, at least, and certainly CUSTOM). But yes, that's where the contants come from.
     
  20. Offline

    cyklo

    OK, 0.7.4 is out. I didn't go with the flags in the end as it made more sense (and was easier!) to integrate them into the "drop" section, much the same way "drop: CONTENTS" works.

    A changelog:
    • Fixed: specifying entity drops in specific worlds didn't work
    • Added new drop types NOTHING and DEFAULT
    @Taxen0 - the example I gave you a couple of pages back using flags isn't how I've done it in the end. However, you can implement your creaturebox integration using the following syntax with the new drop types:

    Code:
      MOB_SPAWNER:
      - tool: ANY
        drop: NOTHING
    
      - tool: [WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD]
        drop: MOB_SPAWNER
    
      - tool: GOLD_SWORD
        drop: DEFAULT
    
     
  21. Offline

    Celtic Minstrel

    It would be nice to be able to detect CREATURE_PIG@SADDLE, CREATURE_WOLF@TAME, CREATURE_WOLF@WILD, perhaps CREATURE_SLIME@<size>. I know some of those aren't currently possible (particularly the saddle one), but perhaps keep them in mind for "eventually"?

    Also, just making sure you saw my previous post. :)
     
  22. Offline

    derfernet

    Just tried it out and after the update it works perfectly! Now I have a world where killing a chicken gives you 10 zombies. I won't tell my server users about that when we go there, though :D.
     
  23. Offline

    Taxen0

    Just tried it and it works great! thanks.
    The only problem is that the spawners always stack now when you pick them up. but that's creaturebox related.
     
  24. Offline

    Shay Williams

    I got a question; could you make it so we can modify what happens on player death? Like when a player dies, we can have a certain item drop rather than their whole inventory?
     
  25. Offline

    Ratte

    Thank you! It made everything a lot easier for me.

    Still one question: Is it possible that there will someday be a combined-damage so i can just change the loot-tables for like Zombies all the time, no matter what they get killed with? Right now i would have to make like tool: any, tool: damage_fire etc. Or is this already covered by "tool: ANY"? Didn't test the newest version yet.
    In the past, Zombies on my server dropped like clocks, compasses etc. with a low chance, but if they died in daylight (fire) or by drowning they still dropped only feathers.
     
  26. Offline

    cyklo

    I believe ANY covers all possible deaths that OtherBlocks keeps track of: this now means DAMAGE values too. So yeah, it should encompass flammable zombies!

    Not at the moment, as I wasn't sure it was something people would use. NPC humans are "CREATURE_MONSTER", but players are not. I guess you might want something like this for a hardcore survival world though?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  27. Offline

    Andrew0085

    Can we use item ID #s instead of their names? Also, any Permissions support?
     
  28. Offline

    cyklo

    I prefer names to numbers for the sake of legibility - it is hard to understand other people's configurations (and indeed debug your own) using Minecraft's internal data values. For example, "CROPS@RIPE" is much more legible than "59@7". If you are trying to convert an old file, go to this file and search for the ID number, and you'll find the right name to use.

    As for permissions - sorry. No plans.
     
  29. Offline

    SavageCore

    I get instant block destroying for stairs and glass when using this, anyway to prevent it? Accidental hitting off glass is rather easy
     
  30. Offline

    cyklo

    This plugin only fires when blocks are broken, so I'm pretty confident it's not this plugin. Have you confirmed by disabling all other plugins and using the latest RB?
     
  31. Offline

    SavageCore

    Ok it runs fine with all other plugins off so I will try and work out which and report back, thanks for the quick response.

    Edit: mcMMO seems to cause it :(
     

Share This Page