/// <summary> /// Handles a players right click /// </summary> public override bool OnPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) { SyncCurrentPlayItem(); NetClientHandler.AddToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.Inventory.GetCurrentItem())); int i = par2World.GetBlockId(par4, par5, par6); if (i > 0 && Block.BlocksList[i].BlockActivated(par2World, par4, par5, par6, par1EntityPlayer)) { return(true); } if (par3ItemStack == null) { return(false); } if (CreativeMode) { int j = par3ItemStack.GetItemDamage(); int k = par3ItemStack.StackSize; bool flag = par3ItemStack.UseItem(par1EntityPlayer, par2World, par4, par5, par6, par7); par3ItemStack.SetItemDamage(j); par3ItemStack.StackSize = k; return(flag); } else { return(par3ItemStack.UseItem(par1EntityPlayer, par2World, par4, par5, par6, par7)); } }
/// <summary> /// Handles a players right click /// </summary> public override bool OnPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) { int i = par2World.GetBlockId(par4, par5, par6); if (i > 0 && Block.BlocksList[i].BlockActivated(par2World, par4, par5, par6, par1EntityPlayer)) { return(true); } if (par3ItemStack == null) { return(false); } else { return(par3ItemStack.UseItem(par1EntityPlayer, par2World, par4, par5, par6, par7)); } }
/// <summary> /// Handles a players right click /// </summary> public override bool OnPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) { int i = par2World.GetBlockId(par4, par5, par6); if (i > 0 && Block.BlocksList[i].BlockActivated(par2World, par4, par5, par6, par1EntityPlayer)) { return(true); } if (par3ItemStack == null) { return(false); } else { int j = par3ItemStack.GetItemDamage(); int k = par3ItemStack.StackSize; bool flag = par3ItemStack.UseItem(par1EntityPlayer, par2World, par4, par5, par6, par7); par3ItemStack.SetItemDamage(j); par3ItemStack.StackSize = k; return(flag); } }