MinecraftJars.NET
1.2.3
See the version list below for details.
dotnet add package MinecraftJars.NET --version 1.2.3
NuGet\Install-Package MinecraftJars.NET -Version 1.2.3
<PackageReference Include="MinecraftJars.NET" Version="1.2.3" />
paket add MinecraftJars.NET --version 1.2.3
#r "nuget: MinecraftJars.NET, 1.2.3"
// Install MinecraftJars.NET as a Cake Addin #addin nuget:?package=MinecraftJars.NET&version=1.2.3 // Install MinecraftJars.NET as a Cake Tool #tool nuget:?package=MinecraftJars.NET&version=1.2.3
MinecraftJars.NET
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:
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
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 project.GetVersions(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.2.3] - 2023-05-31
### Changed
- GetVersion on IProvider now returns all versions for all projects
### Added
- GetVersion on IProject returns all versions for that project
## [1.2.2] - 2023-05-30
### Added
- Add version option to include snapshots during load, by default this is false
- Add indicator to show that the current version is a snapshot / preview / experimental / beta / alpha build
- Add IsSnapshot test cases
### Changed
- Restructure and simplify API directories
### Removed
- Separation of Snapshot ans Standard versions for Mojang, Fabric and Pocketmine plugin, this is handled now via the IsSnapshot indicator on IVersion
## [1.2.1] - 2023-05-29
### Fixed
- Nuget release process
## [1.2.0] - 2023-05-29
### Added
- Add logos in different sizes for fixing Readme on Nuget.org
- Add Fabric Provider Plugin
### Fixed
- Fix logos and links in Readme
### Changed
- Renamed Mohist project from MohistMC to Mohist
## [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