/// <summary> /// This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. /// </summary> public override EntityAnimal SpawnBabyAnimal(EntityAnimal par1EntityAnimal) { EntitySheep entitysheep = (EntitySheep)par1EntityAnimal; EntitySheep entitysheep1 = new EntitySheep(WorldObj); if (Rand.NextBool()) { entitysheep1.SetFleeceColor(GetFleeceColor()); } else { entitysheep1.SetFleeceColor(entitysheep.GetFleeceColor()); } return(entitysheep1); }
/// <summary> /// Called when a player right clicks a entity with a item. /// </summary> public override void UseItemOnEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving) { if (par2EntityLiving is EntitySheep) { EntitySheep entitysheep = (EntitySheep)par2EntityLiving; int i = BlockCloth.GetBlockFromDye(par1ItemStack.GetItemDamage()); if (!entitysheep.GetSheared() && entitysheep.GetFleeceColor() != i) { entitysheep.SetFleeceColor(i); par1ItemStack.StackSize--; } } }