Aneveno.Gaming.Minecraft.Mojang.WebClient 1.0.1

dotnet add package Aneveno.Gaming.Minecraft.Mojang.WebClient --version 1.0.1                
NuGet\Install-Package Aneveno.Gaming.Minecraft.Mojang.WebClient -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aneveno.Gaming.Minecraft.Mojang.WebClient" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aneveno.Gaming.Minecraft.Mojang.WebClient --version 1.0.1                
#r "nuget: Aneveno.Gaming.Minecraft.Mojang.WebClient, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Aneveno.Gaming.Minecraft.Mojang.WebClient as a Cake Addin
#addin nuget:?package=Aneveno.Gaming.Minecraft.Mojang.WebClient&version=1.0.1

// Install Aneveno.Gaming.Minecraft.Mojang.WebClient as a Cake Tool
#tool nuget:?package=Aneveno.Gaming.Minecraft.Mojang.WebClient&version=1.0.1                

Mojang WebClient

Mojang WebClient is a C# wrapper for the Mojang's Minecraft Manifest.

Installation

You can use the library with nuget. Simply search for it in Visual Studio "Aneveno.Gaming.Minecraft.Mojang.WebClient" or install in with CLI MS> Install-Package Aneveno.Gaming.Minecraft.Mojang.WebClient

Usage

MojangWebClient is the class you would want to use for accessing anything related to the minecraft manifest. It contains methods on getting the manifest, requesting more specific information on the manifest's response etc.

Example

MojangWebClient mojang = new MojangWebClient();

MojangManifest manifest = await mojang.GetManifestAsync();

foreach (MojangVersion version in manifest.Versions)
{
    MojangVersionDetails versionDetails = await mojang.GetVersionDetails(version.Url);

    //Parse more version details...

    //Download the server jar from:
    string? serverUrl = versionDetails.Downloads.Server.Url;

    DateTimeOffset? releasedTime = versionDetails.ReleaseTime;
}

The function GetVersionDetails() does nothing more than performing a GET HTTP request and deserializing the content. You get the idea, basically a WebClient for the manifest information from mojang's servers.

Notes

Some of the implementation in the package is missing. For example, some objects from mojang's manifests were not necessary from the implementation needed (such as some files and program arguments), so they don't have implemented c# objects for them to be deserialized. If you need them, open an issue or create a PR with the fixes.

Dependencies

Newtonsoft's JSON for deserialization.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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.0.1 373 10/21/2023
1.0.0 231 10/21/2023