MinecraftJars.NET is a library to give .NET developers easy access for available Minecraft server version as well as Bedrock edition and Proxies.
MinecraftJars.NET is a library to give .NET developers easy access for available Minecraft server version as well as Bedrock edition and Proxies. The motivation for the library is actually a server manager I'm currently working on which will allow to download the latest and greatest Minecraft server version within the manager.
While this repository is providing already the plugins to gather the most popular Minecraft server providers and server, it is easily extendable via the MEF Framework. A developer guide will follow, but I'm pretty sure the geeks will find out themselves on how to do it.
I try to be responsive to Stack Overflow questions in the minecraftjar-net tag and issues logged on this GitHub repository.
If I've helped you and you like some of my work, feel free to buy me a coffee ☕ (or more likely a beer 🍺)
Following provider plugins are already bundled with MinecraftJars.NET:
Mojang:
Vanilla, Bedrock
Paper:
Paper, Folia, Velocity, Waterfall
Purpur:
Purpur
Pocketmine:
Pocketmine
Mohist:
Mohist
Fabric:
Fabric
Spigot
(Important: see details in Plugin Readme): Spigot, BungeeCord
Multiple options are available to install within your project:
Install, using the Nuget Gallery
Install using the Package Manager Console:
Install-Package MinecraftJars.NET
Install using .NET CLI
dotnet add package MinecraftJars.NET
MinecraftJars.NET comes with a ProviderManager class which has to be instantiated, optionally ProviderOptions can be supplied.
Each Plugin provides an interface instance for the provider IProvider as well an interface instance for IEnumerable<IProject> with it's versions IEnumerable<IVersion>.
Since getting the actual download link mostly involves another API query it is accessible via the IVersion.GetDownload() method.
using MinecraftJars;
var providerManager = new ProviderManager();
foreach (var provider in providerManager.GetProviders())
{
Console.WriteLine($"{provider}");
foreach (var project in provider.Projects)
{
Console.WriteLine($"\t{project}");
foreach (var version in await provider.GetVersions(project.Name, new VersionOptions { MaxRecords = 10 }))
{
Console.WriteLine($"\t\t{version}");
var download = await version.GetDownload();
Console.WriteLine($"\t\t\t{download}");
}
Console.WriteLine();
}
Console.WriteLine();
}
To make a long story short have a look at the IProvider, IProject, IVersion and the IDownload interface to see what values are returned by default.
Each plugin could provide more information, which can be found in the README.md of the corresponding plugin.
As an example with the Vanilla Minecraft experience following values are expected:
IProvider = Paper
IEnumerable<IProject> = Paper, Folia, Velocity, Waterfall
IEnumerable<IVersion> for Paper = 1.19.4, 1.19.3, 1.19.2, etc.
IDownload = Build 123Please note:
IVersion.GetDownload() method.Have a look at the Console Demo within the repository. It will run straight out of the box to give you a hint what the library can do for you.
Teneko's Teronis.DotNet for allowing project reference content to be added to the NuGet package during pack process
Icons are provided by Flat Icons