Java Code Examples for net.minecraft.block.material.Material.ANVIL

The following are Jave code examples for showing how to use ANVIL of the net.minecraft.block.material.Material class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Thermionics   File: ItemHammer.java   View Source Code Vote up 5 votes
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state) {
	//Certain materials are just effective with a pickaxe, and by extension, hammers.
       Material material = state.getMaterial();
       if (material == Material.IRON || material == Material.ANVIL || material == Material.ROCK) return this.efficiencyOnProperMaterial;
       
       if (WHITELIST.contains(state.getBlock())) return this.efficiencyOnProperMaterial;
       else return super.getStrVsBlock(stack, state);
   }
 
Example 2
Project: Backmemed   File: BlockAnvil.java   View Source Code Vote up 5 votes
protected BlockAnvil()
{
    super(Material.ANVIL);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, Integer.valueOf(0)));
    this.setLightOpacity(0);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
 
Example 3
Project: CustomWorldGen   File: BlockAnvil.java   View Source Code Vote up 5 votes
protected BlockAnvil()
{
    super(Material.ANVIL);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, Integer.valueOf(0)));
    this.setLightOpacity(0);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
 
Example 4
Project: ProjectEon   File: BlockTesla.java   View Source Code Vote up 4 votes
public BlockTesla() {
    super(Material.ANVIL);
    setCreativeTab(EonContent.TAB);
    setUnlocalizedName("tesla");
    setLightOpacity(0);
}
 
Example 5
Project: customstuff4   File: BitStateMetaMapperTests.java   View Source Code Vote up 4 votes
TestBlock()
{
    super(Material.ANVIL);
}
 
Example 6
Project: uniquecrops   File: ItemPrecisionPick.java   View Source Code Vote up 4 votes
public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();

    if (block == Blocks.OBSIDIAN)
    {
        return this.toolMaterial.getHarvestLevel() == 3;
    }
    else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
    {
        if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
        {
            if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
            {
                if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
                {
                    if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
                    {
                        if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
                        {
                            Material material = blockIn.getMaterial();
                            return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
                        }
                        else
                        {
                            return this.toolMaterial.getHarvestLevel() >= 2;
                        }
                    }
                    else
                    {
                        return this.toolMaterial.getHarvestLevel() >= 1;
                    }
                }
                else
                {
                    return this.toolMaterial.getHarvestLevel() >= 1;
                }
            }
            else
            {
                return this.toolMaterial.getHarvestLevel() >= 2;
            }
        }
        else
        {
            return this.toolMaterial.getHarvestLevel() >= 2;
        }
    }
    else
    {
        return this.toolMaterial.getHarvestLevel() >= 2;
    }
}
 
Example 7
Project: uniquecrops   File: ItemPrecisionPick.java   View Source Code Vote up 4 votes
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Material material = state.getMaterial();
    return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
 
Example 8
Project: Backmemed   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();

    if (block == Blocks.OBSIDIAN)
    {
        return this.toolMaterial.getHarvestLevel() == 3;
    }
    else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
    {
        if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
        {
            if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
            {
                if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
                {
                    if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
                    {
                        if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
                        {
                            Material material = blockIn.getMaterial();
                            return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
                        }
                        else
                        {
                            return this.toolMaterial.getHarvestLevel() >= 2;
                        }
                    }
                    else
                    {
                        return this.toolMaterial.getHarvestLevel() >= 1;
                    }
                }
                else
                {
                    return this.toolMaterial.getHarvestLevel() >= 1;
                }
            }
            else
            {
                return this.toolMaterial.getHarvestLevel() >= 2;
            }
        }
        else
        {
            return this.toolMaterial.getHarvestLevel() >= 2;
        }
    }
    else
    {
        return this.toolMaterial.getHarvestLevel() >= 2;
    }
}
 
Example 9
Project: Backmemed   File: ItemPickaxe.java   View Source Code Vote up 4 votes
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Material material = state.getMaterial();
    return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
 
Example 10
Project: CustomWorldGen   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();

    if (block == Blocks.OBSIDIAN)
    {
        return this.toolMaterial.getHarvestLevel() == 3;
    }
    else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
    {
        if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
        {
            if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
            {
                if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
                {
                    if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
                    {
                        if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
                        {
                            Material material = blockIn.getMaterial();
                            return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
                        }
                        else
                        {
                            return this.toolMaterial.getHarvestLevel() >= 2;
                        }
                    }
                    else
                    {
                        return this.toolMaterial.getHarvestLevel() >= 1;
                    }
                }
                else
                {
                    return this.toolMaterial.getHarvestLevel() >= 1;
                }
            }
            else
            {
                return this.toolMaterial.getHarvestLevel() >= 2;
            }
        }
        else
        {
            return this.toolMaterial.getHarvestLevel() >= 2;
        }
    }
    else
    {
        return this.toolMaterial.getHarvestLevel() >= 2;
    }
}
 
Example 11
Project: CustomWorldGen   File: ItemPickaxe.java   View Source Code Vote up 4 votes
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Material material = state.getMaterial();
    return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
 
Example 12
Project: ExPetrum   File: ItemPickaxe.java   View Source Code Vote up 4 votes
@Override
public boolean canHarvestBlock(IBlockState blockIn)
   {
	return blockIn.getMaterial() == Material.ROCK || ((blockIn.getMaterial() == Material.IRON || blockIn.getMaterial() == Material.ANVIL) || super.canHarvestBlock(blockIn));
   }
 
Example 13
Project: ExPetrum   File: ItemPickaxe.java   View Source Code Vote up 4 votes
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
   {
       Material material = state.getMaterial();
       return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.getStats(stack).getEfficiency();
   }