MinecraftJars.NET 1.4.6

dotnet add package MinecraftJars.NET --version 1.4.6                
NuGet\Install-Package MinecraftJars.NET -Version 1.4.6                
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.4.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MinecraftJars.NET --version 1.4.6                
#r "nuget: MinecraftJars.NET, 1.4.6"                
#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.4.6

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

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, Bedrock

Paper Paper: Paper, Folia, Velocity, Waterfall

Purpur Purpur: Purpur

Pocketmine Pocketmine: Pocketmine

Mohist Mohist: Mohist

Fabric Fabric: Fabric

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 MinecraftJar class which has to be instantiated, optionally ProviderOptions can be supplied. Each Plugin provides an interface instance for the provider IMinecraftProvider as well an interface instance for IEnumerable<IMinecraftProject> with it's versions IEnumerable<IMinecraftVersion>. Since getting the actual download link mostly involves another API query it is accessible via the IMinecraftVersion.GetDownload() method.

using MinecraftJars;

var minecraftJar = new MinecraftJar();

foreach (var provider in minecraftJar.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 IMinecraftProvider, IMinecraftProject, IMinecraftVersion and the IMinecraftDownload 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 Paper Minecraft experience following values can be expected:

  • IMinecraftProvider = Paper
    • IEnumerable<IMinecraftProject> = Paper, Folia, Velocity, Waterfall
      • IEnumerable<IMinecraftVersion> for Paper = 1.19.4, 1.19.3, 1.19.2, etc.
        • IMinecraftDownload = Build 123

Please note:

  • If a version has multiple builds only the latest successful build will be returned via IMinecraftVersion.GetDownload() method.
  • Not all providers will fill all properties in each interface instance. Further information are provided in the README.md of each plugin.

Dependency Injection

An extensions package is available for Dependency Injection. Look up the project but it is as easy as installing it and adding MinecraftJar.NET to the DI.

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 245 6/7/2023
1.4.5 181 6/4/2023
1.4.4 168 6/3/2023
1.4.3 165 6/3/2023
1.4.2 178 6/3/2023
1.3.2 158 6/1/2023
1.3.0 162 6/1/2023
1.2.3 150 5/31/2023
1.2.2 163 5/30/2023
1.2.1 166 5/29/2023
1.1.0 167 5/29/2023
1.0.0 162 5/28/2023

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

## [Unreleased]


## [1.4.6] - 2023-06-07

### Changed
- Do not throw for returning single record methods in MinecraftJar, instead return NULL


## [1.4.5] - 2023-06-04

### Fixed
- Mojang Bedrock versions are now sorted newest to oldest

### Added
- Add property OS to VersionOptions in case a project is for a certain OS only (currently Mojang Bedrock only)


## [1.4.4] - 2023-06-03

### Added
- Implement GetProject on MinecraftJar to get a project by it's name

### Changed
- Renamed Group to ProjectGroup to prevent LINQ group keyword issues
- Renamed Runtime to ProjectRuntime to be consistent


## [1.4.3] - 2023-06-03

### Added
- IMinecraftProject indicates what type of runtime the project requires (e.g. Java, Php or no special runtime)


## [1.4.2] - 2023-06-03

### Removed
- Removed ProviderOptions as it had no use and created an unnecessary dependency

### Added
- Added MinecraftJarOptions so the optional IHttpClientFactory can be provided

### Fixed
- Removed unnecessary dependency of MinecraftJars.Core causing Nuget installation to fail


## [1.4.1] - 2023-06-03

### Changed
- Renamed MinecraftJarManager to MinecraftJar

### Added
- IMinecraftJar interface
- Extension for dependency injection
- Test case for dependency injection
- Automatic deployment of dependency injection injection to nuget.org


## [1.3.2] - 2023-06-01

### Added
- Fabric version snapshot test missing

### Fixed
- Fabric returned only snapshots with the new IsSnapshot flag


## [1.3.1] - 2023-06-01

### Fixed
- All plugin share the same (static) HttpClient now if HttpClientFactory is not provided, preventing Socket exhaustion


## [1.3.0] - 2023-06-01
### Added
- Paper plugin flag pre and snapshot builds as IsSnapshot
- Pocketmine flag alpha builds as IsSnapshot
- Spigot plugin flag pre and snapshot builds as IsSnapshot

### Changed
- Renamed IProvider to IMinecraftProvider
- Renamed IProject to IMinecraftProject
- Renamed IVersion to IMinecraftVersion
- Renamed IDownload to IMinecraftDownload
- Rename ProviderManager to MinecraftProviderManager
- Change LINQ method calls to query format


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