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