mojira.dev
MC-4923

Flint and steel and fire charges can place fire at invalid positions

The bug

Flint and steel places fire at invalid positions, for example on the side of non-inflammable blocks like stone which causes the fire block to disappear the next time it is updated.

How to reproduce

  1. Right click with a flint and steel on a side of block that can't normally catch on fire (Stone for example).

  2. The fire block will appear for a tick.

Note: The fire does not set any entities at the position on fire.

Code analysis

The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.

The reason for this is that the fire block is actually created. However, the public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) method of the net.minecraft.block.BlockFire class is called right after it was placed and removes the block as it is at an invalid position.
This could / should be fixed by having the public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) method of the net.minecraft.item.ItemFlintAndSteel class only place a fire block is the position is valid. Other items like the bucket might be affected as well, however currently you can place water and lava on every block so it causes no problems.

/**
 * Called when a Block is right-clicked with this Item
 *  
 * @param pos The block being right-clicked
 * @param side The side being right-clicked
 */
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
    pos = pos.offset(side);

    if (!playerIn.func_175151_a(pos, side, stack))
    {
        return false;
    }
    else
    {
        // Changed this
        //if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air)
        if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(worldIn, pos))
        {
            worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
            worldIn.setBlockState(pos, Blocks.fire.getDefaultState());
        }

        stack.damageItem(1, playerIn);
        return true;
    }
}
Notes
  • A similar fix would be needed for the fire_charge item and also for the net.minecraft.init.Bootstrap.registerDispenserBehaviors for these items.

  • This fix does not include the use of these items at invalid locations to activate a Nether portal, which could then be moved from net.minecraft.block.BlockFire.onBlockAdded(World, BlockPos, IBlockState) to the respective methods when using an item to create a fire block.

Linked issues

Attachments

Comments 31

Wesley

I don't think this is a bug. I'm pretty sure that flash of fire is how a nether portal knows it needs to be lit.

FireHunterX

You can set the top of a non-flammable block on fire, not the side. Fire will appear if you right-click the top of the block, but it won't if you click on the side.

I'm talking about when you right click the side.

Ezekiel

Is this still a concern in the latest Minecraft version 14w08a? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Sam Bone

Confirmed for 14w27b.

marcono1234

Confirmed for 14w28a

Also somehow with dispensers: MC-8232

21 more comments
Jack

so 1.12.2 is still worked on? we both know nothing is going to change in 1.12.2 nor is there gonna be a 1.12.3 especially not since snapshots are beeing worked on i just think its realy funny how 1 moderator on this bugtacker usually makes completly false statements , tells ppl to not even bother making reports etc. if we shouldnt report bugs in snapshots why are snapshots beeing made? whats the point of this bugtracker ?

violine1101

Please re-read @unknown's comment, he never said that reports for the current release aren't accepted; he just said that reports for future snapshots and releases aren't accepted before those versions are released, and that the new behaviour is very highly likely most definitely probably certainly intended and won't change.

Also, no off-topic comments anymore here, please.

Irbis

@FVbico I will report that tho. This maybe was a bug based feature, but used worldwide and accepted as a feature that was removed since 17w48a. I can only ask mods to not closing it and leaving it for devs to look at our-gamers problem.
New report:
MC-122651

user-f2760

Not fixed for fire charges, they have the same problem.

user-f2760

As of 18w02a it no longer creates a fire block (it seems), but still triggers observers and BUD pistons.

FireHunterX

migrated

Confirmed

fire, flint_and_steel, use-item

Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w02a, Snapshot 13w04a, Minecraft 1.5, ..., Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 18w02a

Minecraft 17w48a, Minecraft 18w05a

Retrieved