Java Code Examples for net.minecraft.init.Items.fire_charge()

The following are Jave code examples for showing how to use fire_charge() 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: DecompiledMinecraft   File: BlockTNT.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (playerIn.getCurrentEquippedItem() != null)
    {
        Item item = playerIn.getCurrentEquippedItem().getItem();

        if (item == Items.flint_and_steel || item == Items.fire_charge)
        {
            this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
            worldIn.setBlockToAir(pos);

            if (item == Items.flint_and_steel)
            {
                playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
            }
            else if (!playerIn.capabilities.isCreativeMode)
            {
                --playerIn.getCurrentEquippedItem().stackSize;
            }

            return true;
        }
    }

    return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}
 
Example 2
Project: DecompiledMinecraft   File: BlockTNT.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (playerIn.getCurrentEquippedItem() != null)
    {
        Item item = playerIn.getCurrentEquippedItem().getItem();

        if (item == Items.flint_and_steel || item == Items.fire_charge)
        {
            this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
            worldIn.setBlockToAir(pos);

            if (item == Items.flint_and_steel)
            {
                playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
            }
            else if (!playerIn.capabilities.isCreativeMode)
            {
                --playerIn.getCurrentEquippedItem().stackSize;
            }

            return true;
        }
    }

    return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}
 
Example 3
Project: BaseClient   File: BlockTNT.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (playerIn.getCurrentEquippedItem() != null)
    {
        Item item = playerIn.getCurrentEquippedItem().getItem();

        if (item == Items.flint_and_steel || item == Items.fire_charge)
        {
            this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
            worldIn.setBlockToAir(pos);

            if (item == Items.flint_and_steel)
            {
                playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
            }
            else if (!playerIn.capabilities.isCreativeMode)
            {
                --playerIn.getCurrentEquippedItem().stackSize;
            }

            return true;
        }
    }

    return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}
 
Example 4
Project: BaseClient   File: BlockTNT.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (playerIn.getCurrentEquippedItem() != null)
    {
        Item item = playerIn.getCurrentEquippedItem().getItem();

        if (item == Items.flint_and_steel || item == Items.fire_charge)
        {
            this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
            worldIn.setBlockToAir(pos);

            if (item == Items.flint_and_steel)
            {
                playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
            }
            else if (!playerIn.capabilities.isCreativeMode)
            {
                --playerIn.getCurrentEquippedItem().stackSize;
            }

            return true;
        }
    }

    return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}