MinecraftJars.NET
1.1.0
See the version list below for details.
dotnet add package MinecraftJars.NET --version 1.1.0
NuGet\Install-Package MinecraftJars.NET -Version 1.1.0
<PackageReference Include="MinecraftJars.NET" Version="1.1.0" />
paket add MinecraftJars.NET --version 1.1.0
#r "nuget: MinecraftJars.NET, 1.1.0"
// Install MinecraftJars.NET as a Cake Addin #addin nuget:?package=MinecraftJars.NET&version=1.1.0 // Install MinecraftJars.NET as a Cake Tool #tool nuget:?package=MinecraftJars.NET&version=1.1.0
MinecraftJars.NET
<p> <a href="https://github.com/tekgator/MinecraftJars.NET/blob/main/LICENSE" alt="License"> <img src="https://img.shields.io/github/license/tekgator/MinecraftJars.NET" /> </a> <img src="https://img.shields.io/github/languages/top/tekgator/MinecraftJars.NET" /> <a href="https://www.nuget.org/packages/MinecraftJars.NET" alt="Nuget"> <img alt="Nuget" src="https://img.shields.io/nuget/dt/MinecraftJars.NET"> </a> <a href="https://github.com/tekgator/MinecraftJars.NET/actions/workflows/build-on-push.yml" alt="BuildStatus"> <img src="https://img.shields.io/github/actions/workflow/status/tekgator/MinecraftJars.NET/build-on-push.yml?branch=main" /> </a> <a href="https://github.com/tekgator/MinecraftJars.NET/releases" alt="Releases"> <img src="https://img.shields.io/github/v/release/tekgator/MinecraftJars.NET" /> </a> <a href="https://github.com/tekgator/MinecraftJars.NET/releases" alt="Releases"> <img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/tekgator/MinecraftJars.NET"> </a> <a href="https://github.com/tekgator/MinecraftJars.NET/commit" alt="Commit"> <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/tekgator/MinecraftJars.NET"> </a> </p>
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.
Support
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 🍺)
Plugins
Following provider plugins are already bundled with MinecraftJars.NET:
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Mojang/Resources/Mojang.png" alt= “Mojang” width="24" height="24"> Mojang: Vanilla, Vanilla Snapshot, Bedrock, Bedrock Preview
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Mohist/Resources/Mohist.png" alt= “Mojang” width="24" height="24"> Mohist: Mohist
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Paper/Resources/Paper.png" alt= “Paper” width="24" height="24"> Paper: Paper, Folia, Velocity, Waterfall
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Purpur/Resources/Purpur.png" alt= “Purpur” width="24" height="24"> Purpur: Purpur
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Pocketmine/Resources/Pocketmine.png" alt= “Pocketmine” width="24" height="24"> Pocketmine: Pocketmine
<img src="MinecraftJars.Plugin/MinecraftJars.Plugin.Spigot/Resources/Spigot.png" alt= “Spigot” width="24" height="24"> Spigot (Important: see details in Plugin Readme): Spigot, BungeeCord
Installing
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
Usage
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();
}
What provider / project / version information is the library providing?
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
= PaperIEnumerable<IProject>
= Paper, Folia, Velocity, WaterfallIEnumerable<IVersion>
for Paper = 1.19.4, 1.19.3, 1.19.2, etc.IDownload
= Build 123
Please note:
- If a version has multiple builds only the latest successful build will be returned via
IVersion.GetDownload()
method. - Not all providers will fill all properties in each interface instance. Further information are provided in the README.md of each plugin.
Demo application
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.
Dependencies and Credits
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
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Microsoft.Extensions.Http (>= 7.0.0)
- System.ComponentModel.Composition (>= 7.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MinecraftJars.NET:
Package | Downloads |
---|---|
MinecraftJars.NET.Extensions.DependencyInjection
Dependency injection extension for MinecraftJars.NET |
GitHub repositories
This package is not used by any popular GitHub repositories.
# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
## [1.1.0] - 2023-05-29
### Added
- Add Pocketmine Provider Plugin
- Add logos to each Readme
## [1.0.0] - 2023-05-28
### Fixed
- In case of Task cancellation for a Spigot build make sure the whole process tree is killed
- Website (Mojang, Spigot) did not respond because AcceptEncoding has to be provided. Always add AcceptEncoding identity
### Changed
- Normalize names of Plugins e.g. SpigotMC is now just Spigot
- Created temp folders during Spigot build include the Plugin name for easier identification
### Added
- First working version
- Unit testing project added
- Add comment for old versions not proving Url due to missing server in Mojang Plugin Readme
- Implement version filter in Spigot version factory
- For Website crawling (Mojang, Spigot) add AcceptLanguage en-US, en to make sure content is not changed due to change of language
- For Website crawling (Mojang, Spigot) add CacheControl with NoCache to get latest version of the website
## [0.1.0] - 2023-05-28
### Added
- First working version
This project is MIT Licensed // Created & maintained by Patrick Weiss