MinecraftJars.NET 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package MinecraftJars.NET --version 1.2.1                
NuGet\Install-Package MinecraftJars.NET -Version 1.2.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="MinecraftJars.NET" Version="1.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MinecraftJars.NET --version 1.2.1                
#r "nuget: MinecraftJars.NET, 1.2.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 MinecraftJars.NET as a Cake Addin
#addin nuget:?package=MinecraftJars.NET&version=1.2.1

// Install MinecraftJars.NET as a Cake Tool
#tool nuget:?package=MinecraftJars.NET&version=1.2.1                

MinecraftJars.NET MinecraftJars.NET

License Language Downloads Build Releases ReleaseDate CommitDate

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 🍺)

ko-fi

Plugins

Following provider plugins are already bundled with MinecraftJars.NET:

Mojang Mojang: Vanilla, Vanilla Snapshot, Bedrock, Bedrock Preview

Paper Paper: Paper, Folia, Velocity, Waterfall

Purpur Purpur: Purpur

Pocketmine Pocketmine: Pocketmine

Mohist Mohist: Mohist

Fabric Fabric: Fabric, Fabric Snapshot

Spigot Spigot (Important: see details in Plugin Readme): Spigot, BungeeCord

Installing

Multiple options are available to install within your project:

  1. Install, using the Nuget Gallery

  2. Install using the Package Manager Console:

    Install-Package MinecraftJars.NET 
    
  3. 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 = Paper
    • IEnumerable<IProject> = Paper, Folia, Velocity, Waterfall
      • IEnumerable<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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
1.4.6 248 6/7/2023
1.4.5 182 6/4/2023
1.4.4 169 6/3/2023
1.4.3 166 6/3/2023
1.4.2 179 6/3/2023
1.3.2 159 6/1/2023
1.3.0 163 6/1/2023
1.2.3 151 5/31/2023
1.2.2 164 5/30/2023
1.2.1 167 5/29/2023
1.1.0 168 5/29/2023
1.0.0 165 5/28/2023

# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]


## [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