ItemPickaxe .java

net.minecraft.item.ItemPickaxe (class, 31 lines): extends ItemTool. members: EFFECTIVE_ON, canHarvestBlock, getStrVsBlock. imports: Sets, Block, Material.

net.minecraft.itemclass31 linescommonextends ItemTool2.2 KB

API Surface (2)

boolean canHarvestBlock(Block blockIn)
float getStrVsBlock(ItemStack stack, Block state)

Fields & Constants (1)

EFFECTIVE_ON

Code Graph: Dependencies (6)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ItemPickaxe.java31 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.item;
2
3
import com.google.common.collect.Sets;
4
import java.util.Set;
5
import net.minecraft.block.Block;
6
import net.minecraft.block.material.Material;
7
import net.minecraft.init.Blocks;
8
9
public class ItemPickaxe extends ItemTool
10
{
11
    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});
12
13
    protected ItemPickaxe(Item.ToolMaterial material)
14
    {
15
        super(2.0F, material, EFFECTIVE_ON);
16
    }
17
18
    /**
19
     * Check whether this Item can harvest the given Block
20
     */
21
    public boolean canHarvestBlock(Block blockIn)
22
    {
23
        return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock ? true : (blockIn.getMaterial() == Material.iron ? true : blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
24
    }
25
26
    public float getStrVsBlock(ItemStack stack, Block state)
27
    {
28
        return state.getMaterial() != Material.iron && state.getMaterial() != Material.anvil && state.getMaterial() != Material.rock ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
29
    }
30
}
31

Deobfuscated MCP 1.8.9 source of ItemPickaxe from Marcelektro/MavenMCP-1.8.9 (net/minecraft/item/ItemPickaxe.java), stored verbatim.