[INACTIVE][Mech] Bukkit of Blocks [412]

Discussion in 'Inactive/Unsupported Plugins' started by Taco, Jan 20, 2011.

  1. Offline

    Taco

    Bukkit of Blocks



    Don't you just hate when you break a double step block and only get one back? Or when you break a glass block and don't get that back? Well this plugin fixes that problem. It forces those blocks to drop items. You can even use golden tools to harvest special blocks!

    This plugin is currently not being worked on due to the plugins like it. If you want to continue this plugin yourself, have at it. Here's the source: Clicky



    Features:
    This plugin allows the user to harvest blocks that cannot normally be harvested. Some blocks require golden tools to be harvested with this plugin. Without golden tools, their drops will be as normal.


    These blocks do not require golden tools:

    - Glass
    - Double Steps
    - Wooden stairs
    - Stone stairs

    These blocks DO require golden tools:
    - Smooth stone
    - Grass
    - Lightstone
    - Clay blocks
    - Snow blocks
    - Leaves
    - Ice

    Known bugs:
    - None yet.


    Changelog:

    2/26/11:

    - No more stupidly long constructor message.
    - Updated for beta 1.3



    Download: Click.

    Last compiled with:
    Bukkit build #412
    Craftbukkit #432
     
    Noppoly and ssechaud like this.
  2. Ok :)
     
  3. Offline

    Lafetus

    Just to clarify the specifics of how the durability "bug" works. Any damage done to the tool while mineing one of the gold tool required blocks can be repaired by right clicking, even if the tool has already broken. Damage done to the tool by blocks that can be mined normally on the other hand will permenantly damage the tool.

    If this is a bug then it should be removed or incorperated into the mod as an option. If it is intentional then it should be made to be optional.

    This bug (if it isn't intentional) could be usefully replicated in another mod for making tools with infinate durability for certain blocks (such as shovels not getting damaged by destroying gravel to make gravel deposits less annoying).
     
  4. This stopped completly working after Minecraft 1.3

    Tested with CB 430 and 435.
     
  5. Offline

    Taco

    I'll update this sometime today.
     
  6. Offline

    iarspider

    Could you please also fix this:
    Code:
    [WARNING] Using the stupidly long constructor com.bukkit.taco.BukkitOfBlocks.BukkitOfBlocks(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is no longer recommended. Go nag the plugin author of Bukkit of Blocks to remove it! (Nothing is broken, we just like to keep code clean.)
    
     
  7. Offline

    xPaw

    After you will update it to latest version, could you make smaller plugin that won't do these golden tools effects? And only drop blocks when destroyed
     
  8. Offline

    Taco

    Fixed constructor error and updated for beta 1.3_01

    So do you not want what the golden tools drop or do you want it to drop without the golden tools?

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

    xPaw

    I don't want the golden tools drops. I mean to not touch these blocks. Only steps/stairs/glass "fixes"
     
  10. Offline

    Taco

    Alright, I'll add an option for this when I do the config.
     
  11. Offline

    xPaw

    Could you do that version for me even without configs? :p
     
  12. Offline

    Noppoly

    Can't wait for config!! 8D
     
  13. Offline

    Celtic Minstrel

    My suggestions/requests:
    • For each of the blocks, have the config file specify whether you need golden tools. Possible even specify exactly what type of tool you need (iron, wood, stone, diamond, gold) or even which tool (hoe, shovel, axe, pick, sword).
    • Add ability to harvest coal ore.
    • Add ability to harvest lapis lazuli ore.
    • Add ability to harvest mob spawners.
    • Add ability to harvest diamond ore.
    • Add ability to harvest soil/farmland.
    • Add ability to harvest redstone ore (item 73, not 74).
    • Add ability to gather surface snow in sheets (item 78) instead of snowballs.
    • Maybe add ability to harvest TNT without it exploding?
    • Scoop up fire with a shovel! :p Okay, that's kinda silly.
    For example, I'd want to allow the steps/stairs to be harvested with normal tools, but the glass I'd want to require a gold tool for, or possibly a diamond tool.
     
  14. Offline

    Noppoly

    Exactly. I'll be all over this as soon as he updates with a config.
     
  15. Offline

    Taco

  16. Offline

    xPaw

    Thanks for sourcecode, i already edited it to fit my needs :)

    Code:
    public class BukkitOfBlocksBlockListener extends BlockListener {
    	public void onBlockBreak( BlockBreakEvent event ) {
    		Material BlockMaterial = event.getBlock( ).getType( );
    		
    		if( BlockMaterial == Material.LEAVES ) {
    			double Random = Math.random( );
    			
    			if( Random <= 0.05 ) {
    				event.getBlock( ).getWorld( ).dropItemNaturally(
    						event.getBlock( ).getLocation( ),
    						new ItemStack( Material.GOLDEN_APPLE, 1 ) );
    			}
    			else if( Random <= 0.099 ) {
    				event.getBlock( ).getWorld( ).dropItemNaturally(
    						event.getBlock( ).getLocation( ),
    						new ItemStack( Material.APPLE, 1 ) );
    			}
    		}
    		else if( BlockMaterial == Material.GLASS
    		||  BlockMaterial == Material.DOUBLE_STEP
    		||  BlockMaterial == Material.WOOD_STAIRS
    		||  BlockMaterial == Material.COBBLESTONE_STAIRS
    		||  BlockMaterial == Material.SNOW_BLOCK )
    		{
    			Integer TypeId = event.getBlock( ).getTypeId( );
    			Integer Stack  = 1;
    			
    			if( TypeId == 43 ) { // Double-step
    				TypeId = 44;
    				Stack  = 2;
    			}
    			
    			event.getBlock( ).getWorld( ).dropItemNaturally(
    					event.getBlock( ).getLocation( ), new ItemStack( TypeId, Stack ) );
    			
    			event.getBlock( ).setTypeId( 0 );
    			event.setCancelled( true );
    			
    			return;
    		}
    	}
    }
    I'm still new to java, if there's anything to improve, tell me
     
  17. Offline

    Celtic Minstrel

    Oh hey, I was hoping for the source. Now I can go make a version that does everything I posted. :D

    MERGE

    ...eh, I pretty much rewrote the thing, but now I have a version that makes the following drop themselves instead of what they normally drop:
    • Smooth stone
    • Grass
    • Coal Ore
    • Leaves
    • Glass
    • Lapis Lazuli Ore
    • TNT (thus suppressing the explosion)
    • Bookshelf
    • Wooden stairs
    • Cobblestone stairs
    • Diamond Ore
    • Soil
    • Redstone Ore
    • Snow (not snow block)
    • Ice
    • Glowstone

    Other things I did was getting fire from Netherrack, getting nine instead of one glowstone from breaking a Glowstone block, and dropping the items inside when breaking a Furnace or Dispenser.

    For each you can choose which tool (axe, pick, hoe, shovel, sword, fists) and what quality (gold, wood, stone, iron, diamond) is needed. I omitted Clay Blocks, Snow Blocks, and Double Slabs because they already drop what you'd expect; Clay Blocks drop four Clay Balls which you can craft into a Clay Block, Snow Blocks drop four Snowballs (note that you need to use a shovel!), and Double Slabs have been fixed to drop two Slabs.

    I dunno, should I post it here in this thread? @Taco
     
  18. Offline

    Shasharala

    Boats should be added to this list!
     
    fyrus12345 likes this.
  19. Offline

    Celtic Minstrel

    Eh, well, Taco didn't respond and one person has requested it, so here's the code. This is literally a zip of my source folder; the jar can be found in target/artifacts and a sample config file in resources. The sample config file will make it behave exactly like the original post, as I recall, while the defaults are quite different (diamond tools for ores, for example, and mining netherrack with a gold hoe drops fire).

    Since the above post, I added back clay and snow blocks dropping themselves, as well as double slabs dropping themselves (ie a single double-slab block rather than two single-slab blocks). I didn't test with non-stone double slabs. I also added a section for leaf drops when not using whichever special tool you've configured to make them drop leaves; if you set that up, they can drop apples, gold apples, and/or cocoa beans as well as saplings.
     
  20. Offline

    Shasharala

    Ooo.
    Testing...
     
  21. Offline

    Celtic Minstrel

    I picked this up for a bit, but I've dropped it now and moved on to OtherBlocks. I recommend anyone else watching this thread do the same.

    For ease of transition, here's an OtherBlocks config file which will, to the best of my knowledge, have the same effect as the original BukkitOfBlocks (except for the double steps which were fixed in Minecraft itself). If anyone would like me to convert a config from my version of BukkitOfBlocks, just post it. :)

    Code:
    otherblocks:
        WOOD_STAIRS:
          - tool: ANY_AXE
            drop: WOOD_STAIRS
            flags: [DEFAULT_NEVER]
        COBBLESTONE_STAIRS:
          - tool: ANY_PICKAXE
            drop: COBBLESTONE_STAIRS
            flags: [DEFAULT_NEVER]
        STONE:
          - tool: GOLD_PICKAXE
            drop: STONE
            flags: [DEFAULT_NEVER]
        GRASS:
          - tool: GOLD_SPADE
            drop: GRASS
            flags: [DEFAULT_NEVER]
        GLOWSTONE:
          - tool: GOLD_PICKAXE
            drop: GLOWSTONE
            flags: [DEFAULT_NEVER]
        CLAY:
          - tool: GOLD_SPADE
            drop: CLAY
            flags: [DEFAULT_NEVER]
        SNOW_BLOCK:
          - tool: GOLD_SPADE
            drop: SNOW_BLOCK
            flags: [DEFAULT_NEVER]
        LEAVES:
          - tool: GOLD_AXE
            drop: LEAVES
            flags: [DEFAULT_NEVER]
        ICE:
          - tool: GOLD_PICKAXE
            drop: ICE
            flags: [DEFAULT_NEVER]
    #    BOAT:
    #      - tool: ANY_AXE
    #        drop: BOAT
    #        flags: [DEFAULT_NEVER]
    (Note: Boats don't work yet in OtherBlocks, but support for them is planned.
     

Share This Page