ProjBobcat 1.16.0

.NET 5.0
Install-Package ProjBobcat -Version 1.16.0
dotnet add package ProjBobcat --version 1.16.0
<PackageReference Include="ProjBobcat" Version="1.16.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ProjBobcat --version 1.16.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProjBobcat, 1.16.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ProjBobcat as a Cake Addin
#addin nuget:?package=ProjBobcat&version=1.16.0

// Install ProjBobcat as a Cake Tool
#tool nuget:?package=ProjBobcat&version=1.16.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ProjBobcat

简体中文

Hx18lYLKR43WAb2 CodeFactor Grade Nuget Nuget GitHub Maintenance GitHub commit activity GitHub closed pull requests GitHub repo size GitHub stars

The next-generation Minecraft launcher core written in C# providing the freest, fastest and the most complete experience.

Developed and maintained by Corona Studio.

Reminder before installation

  • Due to the limitation of the default number of connections in .NET, you need to manually override the default number of connections to ensure that some methods in <DownloadHelper> are executed normally. You can add the following code in App.xaml.cs or the entry point of the program to complete the modification (The maximum value should not exceed 1024)

    using System.Net;
    
    ServicePointManager.DefaultConnectionLimit = 512;
    

Installation

There are two methods for the first step:

  • Clone and copy ProjBobcat's source code to your solution folder, then add ProjBobcat's reference to your project.
  • Directly install ProjBobcat via Nuget Package Manager or simply execute
    Install-Package ProjBobcat
    
    in Package Manager Console.

After the step above is completed, you need to add two lines of code into your program's entry point (App.xaml.cs or something else):

ServiceHelper.Init();
HttpClientHelper.Init();

Roadmap

Function Status
Offline Auth Model
Online Auth Model (Yggdrasil)
Online Auth Model (Microsoft)
Version Isolation
launcher_profiles.json Analysis
launcher_accounts.json Analysis
Nuget Distribution
Old Forge Installation Model
New Forge Installation Model
Optifine Installation Model
Fabric Installation Model
LiteLoader Installation Model
Resource Auto Completion (Multi-thread downloader)
Minecraft: Windows 10 Edition Support (Detector and launcher)
Game log resolver
Game crashing detector WIP

Instruction

Please note: ProjBobcat requires non-32-bit preferred compilation in your main project.

ProjBobcat provides 3 main components & a core to form the whole core framework.

Class Parent Interface Parent Class Function
DefaultGameCore IGameCore NG All Implementations of the Default Launch Core
DefaultLaunchArgumentParser IArgumentParser LaunchArgumentParserBase The Default Argument Analysis Tool
DefaultLauncherProfileParser ILauncherProfileParser LauncherProfileParserBase The Default launcher_profiles.json Analysis Module
DefaultVersionLocator IVersionLocator VersionLocatorBase Game Version Locator

Selective components: | Class | Parent Interface | Parent Class | Function | | - | - | - | - | | DefaultResourceCompleter | IResourceCompleter | NG | All Implementations of the Default Resource Completer |

Quick Startup

Java Detection
var javaList = ProjBobcat.Class.Helper.SystemInfoHelper.FindJava(); // Returns a list of all java installations found in registry.
Core Initialization

var core = new DefaultGameCore
{
  ClientToken = clientToken,
  RootPath = rootPath,
  VersionLocator = new DefaultVersionLocator(rootPath, clientToken)
  {
    LauncherProfileParser = new DefaultLauncherProfileParser(rootPath, clientToken),
    LauncherAccountParser = new DefaultLauncherAccountParser(rootPath, clientToken)
  },
  GameLogResolver = new DefaultGameLogResolver()
};

Game Scaning

List<VersionInfo> gameList = core.VersionLocator.GetAllGames().ToList();

Resource Completion
//Here we use mcbbs' download source, change the uri to meet your need.
var drc = new DefaultResourceCompleter
{
    ResourceInfoResolvers = new List<IResourceInfoResolver>(2)
    {
        new AssetInfoResolver
        {
            AssetIndexUriRoot = "https://download.mcbbs.net/",
            AssetUriRoot = "https://download.mcbbs.net/assets/",
            BasePath = core.RootPath,
            VersionInfo = gameList[0]
        },
        new LibraryInfoResolver
        {
            BasePath = core.RootPath,
            LibraryUriRoot = "https://download.mcbbs.net/maven/",
            VersionInfo = gameList[0]
        }
    }
};

await drc.CheckAndDownloadTaskAsync().ConfigureAwait(false);

Here are some events which you could bind to your program.

Name Method Signature Refers to
GameResourceInfoResolveStatus (object sender, GameResourceInfoResolveEventArgs e) Resolver status
DownloadFileChangedEvent (object sender, DownloadFileChangedEventArgs e) All files download status changed
DownloadFileCompletedEvent (object sender, DownloadFileCompletedEventArgs e) Single file download completed
Launch Configuration

var launchSettings = new LaunchSettings
{
    FallBackGameArguments = new GameArguments // Default game arguments for all games in .minecraft/ as the fallback of specific game launch.
    {
        GcType = GcType.G1Gc, // GC type
        JavaExecutable = javaPath, //The path of Java executable
        Resolution = new ResolutionModel // Game Window's Resolution
        {
            Height = 600, // Height
            Width = 800 // Width
        },
        MinMemory = 512, // Minimal Memory
        MaxMemory = 1024 // Maximum Memory
    },
    Version = versionId, // The version ID of the game to launch, such as 1.7.10 or 1.15.2
    VersionInsulation = false // Version Isolation
    GameResourcePath = Core.RootPath, // Root path of the game resource(.minecraft/)
    GamePath = path, // Root path of the game (.minecraft/versions/)
    VersionLocator = Core.VersionLocator // Game's version locator
};

launchSettings.GameArguments = new GameArguments // (Optional) The arguments of specific game launch, the undefined settings here will be redirected to the fallback settings mentioned previously.
{
    AdvanceArguments = specificArguments , // Advanced launch arguments
    JavaExecutable = specificJavaExecutable, // JAVA's path
    Resolution = specificResolution, // The window's size
    MinMemory = specificMinMemory, // Minimum Memory
    MaxMemory = specificMaxMemory // Maximum Memory
};

Here are some events which you could bind to your program.

Name Method Signature Refers to
GameExitEventDelegate (object sender, GameExitEventArgs e) Game Exit
GameLogEventDelegate (object sender, GameLogEventArgs e) Game Log
LaunchLogEventDelegate (object sender, LaunchLogEventArgs e) Core Log
Define Auth Model

Offline:


launchSettings.Authenticator = new OfflineAuthenticator
{
    Username = "Username"
    LauncherAccountParser = core.VersionLocator.LauncherAccountParser // launcher_profiles.json parser
},

Online:

launchSettings.Authenticator = new YggdrasilAuthenticator
{
    LauncherAccountParser = core.VersionLocator.LauncherAccountParser
    Email = "example@example.com", // Registered E-mail address on Mojang authentication server.
    Password = "password"
};
Launch!

var result = await Core.LaunchTaskAsync(launchSettings).ConfigureAwait(true); // Returns the launch result

License

MIT. This means that you can modify or use our code for any purpose, however copyright notice and permission notice shall be included in all copies or substantial portions of your software.

Disclaimer

ProjBobcat is not affiliated with Mojang or any part of its software.

Hall of Shame

Here we'll list all programs using our code without obeying MIT License.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.16.0 102 6/7/2022
1.12.0 115 4/5/2022
1.9.5 167 1/7/2022
1.8.0 118 12/27/2021
1.7.1 6,096 11/23/2021
1.7.0 5,051 11/23/2021
1.6.0 220 6/21/2021
1.5.4.5 161 4/27/2021
1.5.4 162 4/5/2021
1.5.3 192 3/26/2021
1.5.2 232 1/20/2021
1.5.0 221 11/18/2020
1.0.7 265 11/4/2020
1.0.6.11 346 11/3/2020
1.0.6.10 359 11/3/2020
1.0.6.9 373 11/3/2020
1.0.6.8 390 11/3/2020
1.0.6.7 221 11/3/2020
1.0.6.6 227 11/3/2020
1.0.6.5 310 9/7/2020
1.0.6.4 380 9/5/2020
1.0.6.3 481 8/29/2020
1.0.6.2 434 8/21/2020
1.0.6.1 281 8/21/2020
1.0.6 284 8/21/2020
1.0.5.15 285 8/21/2020
1.0.5.14 280 8/21/2020
1.0.5.13 231 8/21/2020
1.0.5.12 230 8/21/2020
1.0.5.11 288 8/21/2020
1.0.5.10 299 8/21/2020
1.0.5.9 304 8/21/2020
1.0.5.8 307 8/21/2020
1.0.5.7 344 8/21/2020
1.0.5.6 363 8/21/2020
1.0.5.5 358 8/21/2020
1.0.5.4 361 8/21/2020
1.0.5.3 343 8/21/2020
1.0.5.2 270 8/21/2020
1.0.5.1 263 8/10/2020
1.0.5 270 8/8/2020
1.0.4.14 270 8/8/2020
1.0.4.13 303 8/7/2020
1.0.4.12 307 8/7/2020
1.0.4.11 311 8/7/2020
1.0.4.10 279 8/7/2020
1.0.4.9 296 8/7/2020
1.0.4.8 283 8/3/2020
1.0.4.7 288 8/3/2020
1.0.4.6 304 8/3/2020
1.0.4.5 314 8/3/2020
1.0.4.4 277 7/31/2020
1.0.4.3 297 7/31/2020
1.0.4.2 310 7/31/2020
1.0.4.1 432 7/30/2020
1.0.4 400 7/30/2020
1.0.3.8 266 7/30/2020
1.0.3.7 273 7/29/2020
1.0.3.6 293 7/24/2020
1.0.3.5 287 7/2/2020
1.0.3.4 330 7/2/2020
1.0.3.3 389 7/2/2020
1.0.3.2 291 7/2/2020
1.0.3.1 342 7/1/2020
1.0.3 272 5/31/2020
1.0.2 395 3/30/2020
1.0.1.4 318 3/2/2020
1.0.1.1 296 2/21/2020
1.0.1 297 2/17/2020
1.0.0.3 339 2/10/2020
1.0.0.2 359 2/9/2020
1.0.0.1 329 2/8/2020
1.0.0 302 2/7/2020

fix potential stuck issue
fix bugs DownloadHelper.cs
fix high memory consumption in the DownloadHelper.cs
add support for Quilt installation