Ejemplo n.º 1
0
        protected override void Func_48434_c(ItemStack par1ItemStack)
        {
            par1ItemStack.OnCrafting(ThePlayer.WorldObj, ThePlayer, Field_48437_f);
            Field_48437_f = 0;

            if (par1ItemStack.ItemID == Item.IngotIron.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.AcquireIron, 1);
            }

            if (par1ItemStack.ItemID == Item.FishCooked.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.CookFish, 1);
            }
        }
Ejemplo n.º 2
0
        protected override void Func_48434_c(ItemStack par1ItemStack)
        {
            par1ItemStack.OnCrafting(ThePlayer.WorldObj, ThePlayer, Field_48436_g);
            Field_48436_g = 0;

            if (par1ItemStack.ItemID == Block.Workbench.BlockID)
            {
                ThePlayer.AddStat(AchievementList.BuildWorkBench, 1);
            }
            else if (par1ItemStack.ItemID == Item.PickaxeWood.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.BuildPickaxe, 1);
            }
            else if (par1ItemStack.ItemID == Block.StoneOvenIdle.BlockID)
            {
                ThePlayer.AddStat(AchievementList.BuildFurnace, 1);
            }
            else if (par1ItemStack.ItemID == Item.HoeWood.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.BuildHoe, 1);
            }
            else if (par1ItemStack.ItemID == Item.Bread.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.MakeBread, 1);
            }
            else if (par1ItemStack.ItemID == Item.Cake.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.BakeCake, 1);
            }
            else if (par1ItemStack.ItemID == Item.PickaxeStone.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.BuildBetterPickaxe, 1);
            }
            else if (par1ItemStack.ItemID == Item.SwordWood.ShiftedIndex)
            {
                ThePlayer.AddStat(AchievementList.BuildSword, 1);
            }
            else if (par1ItemStack.ItemID == Block.EnchantmentTable.BlockID)
            {
                ThePlayer.AddStat(AchievementList.Enchantments, 1);
            }
            else if (par1ItemStack.ItemID == Block.BookShelf.BlockID)
            {
                ThePlayer.AddStat(AchievementList.Bookcase, 1);
            }
        }
Ejemplo n.º 3
0
 public GuiContainerCreative(EntityPlayer par1EntityPlayer) : base(new ContainerCreative(par1EntityPlayer))
 {
     CurrentScroll = 0.0F;
     IsScrolling   = false;
     par1EntityPlayer.CraftingInventory = InventorySlots;
     AllowUserInput = true;
     par1EntityPlayer.AddStat(AchievementList.OpenInventory, 1);
     YSize = 208;
 }
Ejemplo n.º 4
0
        public void OnDestroyBlock(int par1, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
        {
            bool flag = Item.ItemsList[ItemID].OnBlockDestroyed(this, par1, par2, par3, par4, par5EntityPlayer);

            if (flag)
            {
                par5EntityPlayer.AddStat(StatList.ObjectUseStats[ItemID], 1);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Calls the corresponding fct in di
        /// </summary>
        public void HitEntity(EntityLiving par1EntityLiving, EntityPlayer par2EntityPlayer)
        {
            bool flag = Item.ItemsList[ItemID].HitEntity(this, par1EntityLiving, par2EntityPlayer);

            if (flag)
            {
                par2EntityPlayer.AddStat(StatList.ObjectUseStats[ItemID], 1);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Uses the item stack by the player. Gives the coordinates of the block its being used against and the side. Args:
        /// player, world, x, y, z, side
        /// </summary>
        public bool UseItem(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6)
        {
            bool flag = GetItem().OnItemUse(this, par1EntityPlayer, par2World, par3, par4, par5, par6);

            if (flag)
            {
                par1EntityPlayer.AddStat(StatList.ObjectUseStats[ItemID], 1);
            }

            return(flag);
        }
 /// <summary>
 /// Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the
 /// block and l is the block's subtype/damage.
 /// </summary>
 public override void HarvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
 {
     if (!par1World.IsRemote && par2EntityPlayer.GetCurrentEquippedItem() != null && par2EntityPlayer.GetCurrentEquippedItem().ItemID == Item.Shears.ShiftedIndex)
     {
         par2EntityPlayer.AddStat(StatList.MineBlockStatArray[BlockID], 1);
         DropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.Leaves.BlockID, 1, par6 & 3));
     }
     else
     {
         base.HarvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the
        /// block and l is the block's subtype/damage.
        /// </summary>
        public override void HarvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
        {
            int        i          = Item.Snowball.ShiftedIndex;
            float      f          = 0.7F;
            float      d          = (par1World.Rand.NextFloat() * f) + (1.0F - f) * 0.5F;
            float      d1         = (par1World.Rand.NextFloat() * f) + (1.0F - f) * 0.5F;
            float      d2         = (par1World.Rand.NextFloat() * f) + (1.0F - f) * 0.5F;
            EntityItem entityitem = new EntityItem(par1World, par3 + d, par4 + d1, par5 + d2, new ItemStack(i, 1, 0));

            entityitem.DelayBeforeCanPickup = 10;
            par1World.SpawnEntityInWorld(entityitem);
            par1World.SetBlockWithNotify(par3, par4, par5, 0);
            par2EntityPlayer.AddStat(StatList.MineBlockStatArray[BlockID], 1);
        }
Ejemplo n.º 9
0
        public virtual int CatchFish()
        {
            byte byte0 = 0;

            if (Bobber != null)
            {
                float  d  = Angler.PosX - PosX;
                float  d2 = Angler.PosY - PosY;
                float  d4 = Angler.PosZ - PosZ;
                double d6 = MathHelper2.Sqrt_double(d * d + d2 * d2 + d4 * d4);
                float  d8 = 0.10000000000000001F;
                Bobber.MotionX += d * d8;
                Bobber.MotionY += d2 * d8 + MathHelper2.Sqrt_double(d6) * 0.080000000000000002F;
                Bobber.MotionZ += d4 * d8;
                byte0           = 3;
            }
            else if (TicksCatchable > 0)
            {
                EntityItem entityitem = new EntityItem(WorldObj, PosX, PosY, PosZ, new ItemStack(Item.FishRaw));
                float      d1         = Angler.PosX - PosX;
                float      d3         = Angler.PosY - PosY;
                float      d5         = Angler.PosZ - PosZ;
                double     d7         = MathHelper2.Sqrt_double(d1 * d1 + d3 * d3 + d5 * d5);
                float      d9         = 0.10000000000000001F;
                entityitem.MotionX = d1 * d9;
                entityitem.MotionY = d3 * d9 + MathHelper2.Sqrt_double(d7) * 0.080000000000000002F;
                entityitem.MotionZ = d5 * d9;
                WorldObj.SpawnEntityInWorld(entityitem);
                Angler.AddStat(StatList.FishCaughtStat, 1);
                byte0 = 1;
            }

            if (InGround)
            {
                byte0 = 2;
            }

            SetDead();
            Angler.FishEntity = null;
            return(byte0);
        }
 public GuiInventory(EntityPlayer par1EntityPlayer) : base(par1EntityPlayer.InventorySlots)
 {
     AllowUserInput = true;
     par1EntityPlayer.AddStat(AchievementList.OpenInventory, 1);
 }
Ejemplo n.º 11
0
 public void OnCrafting(World par1World, EntityPlayer par2EntityPlayer, int par3)
 {
     par2EntityPlayer.AddStat(StatList.ObjectCraftStats[ItemID], par3);
     Item.ItemsList[ItemID].OnCreated(this, par1World, par2EntityPlayer);
 }