/// <summary> /// Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. /// </summary> public override bool Interact(EntityPlayer par1EntityPlayer) { if (RiddenByEntity != null && (RiddenByEntity is EntityPlayer) && RiddenByEntity != par1EntityPlayer) { return(true); } if (!WorldObj.IsRemote) { par1EntityPlayer.MountEntity(this); } return(true); }
/// <summary> /// Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. /// </summary> public override bool Interact(EntityPlayer par1EntityPlayer) { if (!base.Interact(par1EntityPlayer)) { if (GetSaddled() && !WorldObj.IsRemote && (RiddenByEntity == null || RiddenByEntity == par1EntityPlayer)) { par1EntityPlayer.MountEntity(this); return(true); } else { return(false); } } else { return(true); } }
/// <summary> /// Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. /// </summary> public override bool Interact(EntityPlayer par1EntityPlayer) { if (MinecartType == 0) { if (RiddenByEntity != null && (RiddenByEntity is EntityPlayer) && RiddenByEntity != par1EntityPlayer) { return(true); } if (!WorldObj.IsRemote) { par1EntityPlayer.MountEntity(this); } } else if (MinecartType == 1) { if (!WorldObj.IsRemote) { par1EntityPlayer.DisplayGUIChest(this); } } else if (MinecartType == 2) { ItemStack itemstack = par1EntityPlayer.Inventory.GetCurrentItem(); if (itemstack != null && itemstack.ItemID == Item.Coal.ShiftedIndex) { if (--itemstack.StackSize == 0) { par1EntityPlayer.Inventory.SetInventorySlotContents(par1EntityPlayer.Inventory.CurrentItem, null); } Fuel += 3600; } PushX = PosX - par1EntityPlayer.PosX; PushZ = PosZ - par1EntityPlayer.PosZ; } return(true); }