Jump to content

raiwhiz

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by raiwhiz

  1. Actually, I had tried to copy the private static final Set and add all bricks in it. But nothing chage. private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE, Blocks.BRICK_BLOCK, Blocks.BRICK_STAIRS, Blocks.RED_NETHER_BRICK, Blocks.NETHER_BRICK, Blocks.NETHER_BRICK_STAIRS, Blocks.STONE_BRICK_STAIRS, Blocks.STONEBRICK } ); public class NewTool extends ItemTool { public NewTool() { super(3.0f, -1.5f, ToolMaterial.DIAMOND, EFFECTIVE_ON); this.setHarvestLevel("pickaxe", 3); this.setHarvestLevel("shovel", 3); } }
  2. Hey, guys! I just create a simple tool: public class NewTool extends ItemTool { public NewTool() { super(3.0f, -1.5f, ToolMaterial.DIAMOND, new HashSet()); this.setHarvestLevel("pickaxe", 3); this.setHarvestLevel("shovel", 3); } } But I found it can't harvest bricks! I check the ItemPickaxe code, I found it needs to overwrite canHarvestBlock. So I do this: @Override public boolean canHarvestBlock(IBlockState blockIn) { return true; } Now it worked! Bricks can be harvested. I set a debug point to canHarvestBlock(). Only harvesting bricks it triggered. So, is this a bug that Forge missing to take control bricks? Or it's design that needs canHarvestBlock() to control bricks? Otherwise, is it OK to transfer new HashSet() for effectiveBlocksIn when I using Forge? (The fourth parameter) It seems no probrem when I do the test in game. super(3.0f, -1.5f, ToolMaterial.DIAMOND, new HashSet()); Forge version: 12.18.3.2422 Thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.