Java Code Examples for net.minecraft.init.Items.FLINT

The following are Jave code examples for showing how to use FLINT of the net.minecraft.init.Items 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: BetterBeginningsReborn   File: ItemHammer.java   View Source Code Vote up 6 votes
public static ItemStack getCrushResult(Block broken, IBlockState state)
{
    if (broken == Blocks.STONE && broken.getMetaFromState(state) == 0)
    {
        return new ItemStack(Blocks.COBBLESTONE);
    }
    else if (broken == Blocks.COBBLESTONE)
    {
        return new ItemStack(Blocks.GRAVEL);
    }
    else if (broken == Blocks.GRAVEL)
    {
        return new ItemStack(Items.FLINT, 2);
    }
    else if (broken == Blocks.SANDSTONE)
    {
        return new ItemStack(Blocks.SAND);
    }
    else
    {
        return null;
    }
}
 
Example 2
Project: Backmemed   File: BlockGravel.java   View Source Code Vote up 5 votes
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    if (fortune > 3)
    {
        fortune = 3;
    }

    return rand.nextInt(10 - fortune * 3) == 0 ? Items.FLINT : super.getItemDropped(state, rand, fortune);
}
 
Example 3
Project: CustomWorldGen   File: BlockGravel.java   View Source Code Vote up 5 votes
/**
 * Get the Item that this Block should drop when harvested.
 */
@Nullable
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    if (fortune > 3)
    {
        fortune = 3;
    }

    return rand.nextInt(10 - fortune * 3) == 0 ? Items.FLINT : Item.getItemFromBlock(this);
}