11
11
[ ![ Discord] ( https://img.shields.io/discord/795952027443527690?label=discord\& logo=discord\& style=for-the-badge )] ( https://discord.gg/cDW2pvwHSc )
12
12
13
13
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...)
15
15
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 )
19
17
20
18
## Features
21
19
22
20
* Authenticate with Microsoft Xbox account
23
21
* Get vanilla versions and installed versions
24
22
* Install vanilla versions
25
- * Launch any vanilla version (tested up to 1.20.4 )
23
+ * Launch any vanilla version (tested up to 1.21 )
26
24
* Launch Forge, Optifine, FabricMC, LiteLoader or any other custom version
27
25
* Install Java runtime
28
26
* Install LiteLoader, FabricMC
29
27
* Launch with options (direct server connecting, screen resolution, JVM arguments)
30
28
* Cross-platform (Windows, Linux, macOS)
31
29
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 )
33
31
34
32
## Install
35
33
36
34
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
+
37
92
## Documentation
38
93
39
- ** [ Official documentation] ( https://alphabs.gitbook.io/cmllib/cmllib.core/cmllib.core ) **
94
+ ** [ Official documentation] ( https://alphabs.gitbook.io/cmllib ) **
40
95
41
- ** [ 한국어 문서] ( https://alphabs.gitbook.io/cmllib/v/ko/cmllib.core/cmllib.core ) **
96
+ ** [ 한국어 문서] ( https://alphabs.gitbook.io/cmllib/v/v4-kr ) **
42
97
43
98
## Example
44
99
@@ -50,4 +105,4 @@ Install the [CmlLib.Core Nuget package](https://www.nuget.org/packages/CmlLib.Co
50
105
<img src =" https://contrib.rocks/image?repo=cmllib/cmllib.core " />
51
106
</a >
52
107
53
- Made with [ contrib.rocks] ( https://contrib.rocks ) .
108
+ Made with [ contrib.rocks] ( https://contrib.rocks ) .
0 commit comments