Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaBs committed Jul 7, 2024
1 parent a4cf299 commit 6fdce82
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 120 deletions.
111 changes: 0 additions & 111 deletions README-4.0.0.md

This file was deleted.

73 changes: 64 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,89 @@
[![Discord](https://img.shields.io/discord/795952027443527690?label=discord\&logo=discord\&style=for-the-badge)](https://discord.gg/cDW2pvwHSc)

CmlLib.Core is a Minecraft launcher library for .NET\
Supports all versions, Forge, and any custom version
support all vanilla and mod versions (including Forge, Fabric, etc...)

[한국어 문서](https://alphabs.gitbook.io/cmllib/v/ko/cmllib.core/cmllib.core)

[简体中文 README](https://github.com/AlphaBs/CmlLib.Core/blob/master/docs/README-chs.md)
[한국어 문서](https://alphabs.gitbook.io/cmllib/v/v4-kr)

## Features

* Authenticate with Microsoft Xbox account
* Get vanilla versions and installed versions
* Install vanilla versions
* Launch any vanilla version (tested up to 1.20.4)
* Launch any vanilla version (tested up to 1.21)
* Launch Forge, Optifine, FabricMC, LiteLoader or any other custom version
* Install Java runtime
* Install LiteLoader, FabricMC
* Launch with options (direct server connecting, screen resolution, JVM arguments)
* Cross-platform (Windows, Linux, macOS)

[Go to the wiki for all features](https://alphabs.gitbook.io/cmllib/cmllib.core/cmllib.core)
[Go to the wiki for all features](https://alphabs.gitbook.io/cmllib)

## Install

Install the [CmlLib.Core Nuget package](https://www.nuget.org/packages/CmlLib.Core)

## QuickStart

### Get All Versions

```csharp
using CmlLib.Core;

var launcher = new MinecraftLauncher();
var versions = await launcher.GetAllVersionsAsync();
foreach (var version in versions)
{
Console.WriteLine($"{version.Type} {version.Name}");
}
```

### Launch the Game

```csharp
using CmlLib.Core;
using CmlLib.Core.ProcessBuilder;

var launcher = new MinecraftLauncher();
var process = await launcher.InstallAndBuildProcessAsync("1.21", new MLaunchOption());
process.Start();
```

### Launch the Game with Options

```csharp
using CmlLib.Core;
using CmlLib.Core.Auth;
using CmlLib.Core.ProcessBuilder;

var path = new MinecraftPath("./my_game_dir");
var launcher = new MinecraftLauncher(path);
launcher.FileProgressChanged += (sender, args) =>
{
Console.WriteLine($"Name: {args.Name}");
Console.WriteLine($"Type: {args.EventType}");
Console.WriteLine($"Total: {args.TotalTasks}");
Console.WriteLine($"Progressed: {args.ProgressedTasks}");
};
launcher.ByteProgressChanged += (sender, args) =>
{
Console.WriteLine($"{args.ProgressedBytes} bytes / {args.TotalBytes} bytes");
};

await launcher.InstallAsync("1.20.4");
var process = await launcher.BuildProcessAsync("1.20.4", new MLaunchOption
{
Session = MSession.CreateOfflineSession("Gamer123"),
MaximumRamMb = 4096
});
process.Start();
```

## Documentation

**[Official documentation](https://alphabs.gitbook.io/cmllib/cmllib.core/cmllib.core)**
**[Official documentation](https://alphabs.gitbook.io/cmllib)**

**[한국어 문서](https://alphabs.gitbook.io/cmllib/v/ko/cmllib.core/cmllib.core)**
**[한국어 문서](https://alphabs.gitbook.io/cmllib/v/v4-kr)**

## Example

Expand All @@ -50,4 +105,4 @@ Install the [CmlLib.Core Nuget package](https://www.nuget.org/packages/CmlLib.Co
<img src="https://contrib.rocks/image?repo=cmllib/cmllib.core" />
</a>

Made with [contrib.rocks](https://contrib.rocks).
Made with [contrib.rocks](https://contrib.rocks).

0 comments on commit 6fdce82

Please sign in to comment.