paper

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	provider.BaseProvider
}

func New

func New() *Provider

func (*Provider) Download

func (p *Provider) Download(gameVersion, serverVersion, installDir string, onProgress func(current, total int64)) error

Download downloads the PaperMC server JAR to the specified installation directory.

Parameters:

  • gameVersion: the Minecraft version string (e.g., "1.16.5", "1.13-pre7").
  • serverVersion: the Paper build number.
  • installDir: the directory where the server JAR will be saved.
  • onProgress: a callback function to report download progress.

Returns:

  • error: an error if the download fails.

func (*Provider) DownloadURL

func (p *Provider) DownloadURL(gameVersion, serverVersion string) (string, error)

DownloadURL returns the download URL for the PaperMC server JAR for a given game version and build number.

Parameters:

  • gameVersion: the Minecraft version string (e.g., "1.16.5", "1.13-pre7").
  • serverVersion: the PaperMC build number for the specified version.

Returns:

  • string: the direct download URL for the PaperMC server JAR file if the build exists.
  • error: an error if the game version or build number is not found, or if any HTTP or JSON decoding issues occur.

func (*Provider) GameVersions

func (p *Provider) GameVersions() ([]string, error)

GameVersions fetches the list of all Minecraft paper server versions from the official PaperMC API version manifest.

Returns:

  • []string: a slice of Minecraft paper server versions (e.g., "1.16.5", "1.13-pre7").
  • error: an error if any HTTP or JSON decoding issues occur.

func (*Provider) ServerVersions

func (p *Provider) ServerVersions(gameVersion string) ([]string, error)

ServerVersions fetches the list of all available PaperMC build numbers for a given game version.

Parameters:

  • gameVersion: the Minecraft version string (e.g., "1.16.5", "1.13-pre7").

Returns:

  • []string: a slice of build numbers for the specified game version.
  • error: an error if the game version is not supported or if any HTTP or JSON decoding issues occur.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL