Giter Club home page Giter Club logo

cmllib.core's Introduction

CmlLib.Core

Minecraft Launcher Library

This library is minecraft launcher library for .NET Core and .NET Framework
Support all version, with Forge

What is different between CmlLib.Core and CmlLib?

CmlLib.Core is developed using .NET Core and support crossplatform. but CmlLib doesn't support it and will be deprecated.

Contacts

Email : [email protected]
Discord : ksi123456ab#3719

License

MIT License

Crossplatform

.NET Core version support crossplatform. It is tested in Windows10, Ubuntu 18.04, macOS Catalina

Dependency

Newtonsoft.Json
SharpZipLib

Functions

  • Online / Offline Login
  • Download game files in mojang file server
  • Launch All Versions (tested up to 1.15.2)
  • Launch Forge, Optifine or custom versions
  • Download minecraft java runtime in mojang file server
  • Launch with options (direct server connecting, screen resolution)
  • Support cross-platform

How To Use

If you want to learn more features of this library, go to wiki

Sample Code

Install

Install Nuget Package 'CmlLib.Core'
or download dll files in Releases and add reference to your project.

write this on the top of your source code:

 using CmlLib;
 using CmlLib.Core;

Sample

Login

 var login = new MLogin();
 var session = login.TryAutoLogin(); // 'session' is used in LaunchOption

 if (session.Result != MLoginResult.Success) // failed to auto login
 {
     var email = Console.ReadLine();
     var pw = Console.ReadLine();
     session = login.Authenticate(email, pw);

     if (session.Result != MLoginResult.Success)
          throw new Exception(session.Result.ToString()) // failed to login
 }

Offline Login

 var session = MSession.GetOfflineSession("USERNAME"); // 'session' is used in LaunchOption

Launch

 //var path = new Minecraft("your minecraft directory);
 var path = Minecraft.GetOSDefaultPath(); // mc directory

 var launcher = new CmlLib.Cml(path);
 launcher.ProgressChanged += (s, e) =>
 {
      Console.WriteLine("{0}%", e.ProgressPercentage);
 };
 launcher.FileChanged += (e) =>
 {
      Console.WriteLine("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount);
 };

 foreach (var item in launcher.ProfileInfos)
 {
     Console.WriteLine(item.Name);
 }

 var launchOption = new MLaunchOption
 {
     MaximumRamMb = 1024,
     Session = session, // Login Session. ex) Session = MSession.GetOfflineSession("hello")

     //LauncherName = "MyLauncher",
     //ScreenWidth = 1600,
     //ScreenHeigth = 900,
     //ServerIp = "mc.hypixel.net"
 };

 // launch forge
 //var process = launcher.Launch("1.12.2", "14.23.5.2768", launchOption);

 // launch vanila
 var process = launcher.Launch("1.15.2", launchOption);

 process.Start();

cmllib.core's People

Contributors

alphabs avatar m1xt3nz avatar ilsubyeega avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.