001    package net.minecraft.src;
002    
003    public class ItemFlintAndSteel extends Item
004    {
005        public ItemFlintAndSteel(int par1)
006        {
007            super(par1);
008            this.maxStackSize = 1;
009            this.setMaxDamage(64);
010            this.setTabToDisplayOn(CreativeTabs.tabTools);
011        }
012    
013        public boolean tryPlaceIntoWorld(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
014        {
015            if (par7 == 0)
016            {
017                --par5;
018            }
019    
020            if (par7 == 1)
021            {
022                ++par5;
023            }
024    
025            if (par7 == 2)
026            {
027                --par6;
028            }
029    
030            if (par7 == 3)
031            {
032                ++par6;
033            }
034    
035            if (par7 == 4)
036            {
037                --par4;
038            }
039    
040            if (par7 == 5)
041            {
042                ++par4;
043            }
044    
045            if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
046            {
047                return false;
048            }
049            else
050            {
051                int var11 = par3World.getBlockId(par4, par5, par6);
052    
053                if (var11 == 0)
054                {
055                    par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
056                    par3World.setBlockWithNotify(par4, par5, par6, Block.fire.blockID);
057                }
058    
059                par1ItemStack.damageItem(1, par2EntityPlayer);
060                return true;
061            }
062        }
063    }