Skip to content

Commit 6fdce82

Browse files
committed
docs: update README
1 parent a4cf299 commit 6fdce82

File tree

2 files changed

+64
-120
lines changed

2 files changed

+64
-120
lines changed

README-4.0.0.md

Lines changed: 0 additions & 111 deletions
This file was deleted.

README.md

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,89 @@
1111
[![Discord](https://img.shields.io/discord/795952027443527690?label=discord\&logo=discord\&style=for-the-badge)](https://discord.gg/cDW2pvwHSc)
1212

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

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

2018
## Features
2119

2220
* Authenticate with Microsoft Xbox account
2321
* Get vanilla versions and installed versions
2422
* Install vanilla versions
25-
* Launch any vanilla version (tested up to 1.20.4)
23+
* Launch any vanilla version (tested up to 1.21)
2624
* Launch Forge, Optifine, FabricMC, LiteLoader or any other custom version
2725
* Install Java runtime
2826
* Install LiteLoader, FabricMC
2927
* Launch with options (direct server connecting, screen resolution, JVM arguments)
3028
* Cross-platform (Windows, Linux, macOS)
3129

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

3432
## Install
3533

3634
Install the [CmlLib.Core Nuget package](https://www.nuget.org/packages/CmlLib.Core)
35+
36+
## QuickStart
37+
38+
### Get All Versions
39+
40+
```csharp
41+
using CmlLib.Core;
42+
43+
var launcher = new MinecraftLauncher();
44+
var versions = await launcher.GetAllVersionsAsync();
45+
foreach (var version in versions)
46+
{
47+
Console.WriteLine($"{version.Type} {version.Name}");
48+
}
49+
```
50+
51+
### Launch the Game
52+
53+
```csharp
54+
using CmlLib.Core;
55+
using CmlLib.Core.ProcessBuilder;
56+
57+
var launcher = new MinecraftLauncher();
58+
var process = await launcher.InstallAndBuildProcessAsync("1.21", new MLaunchOption());
59+
process.Start();
60+
```
61+
62+
### Launch the Game with Options
63+
64+
```csharp
65+
using CmlLib.Core;
66+
using CmlLib.Core.Auth;
67+
using CmlLib.Core.ProcessBuilder;
68+
69+
var path = new MinecraftPath("./my_game_dir");
70+
var launcher = new MinecraftLauncher(path);
71+
launcher.FileProgressChanged += (sender, args) =>
72+
{
73+
Console.WriteLine($"Name: {args.Name}");
74+
Console.WriteLine($"Type: {args.EventType}");
75+
Console.WriteLine($"Total: {args.TotalTasks}");
76+
Console.WriteLine($"Progressed: {args.ProgressedTasks}");
77+
};
78+
launcher.ByteProgressChanged += (sender, args) =>
79+
{
80+
Console.WriteLine($"{args.ProgressedBytes} bytes / {args.TotalBytes} bytes");
81+
};
82+
83+
await launcher.InstallAsync("1.20.4");
84+
var process = await launcher.BuildProcessAsync("1.20.4", new MLaunchOption
85+
{
86+
Session = MSession.CreateOfflineSession("Gamer123"),
87+
MaximumRamMb = 4096
88+
});
89+
process.Start();
90+
```
91+
3792
## Documentation
3893

39-
**[Official documentation](https://alphabs.gitbook.io/cmllib/cmllib.core/cmllib.core)**
94+
**[Official documentation](https://alphabs.gitbook.io/cmllib)**
4095

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

4398
## Example
4499

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

53-
Made with [contrib.rocks](https://contrib.rocks).
108+
Made with [contrib.rocks](https://contrib.rocks).

0 commit comments

Comments
 (0)