minecraft

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package minecraft provides the JSON-serializable model, mapper, and option decoder for the Minecraft layer. It registers itself with the jsonapi registry via init().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeOptions

func DecodeOptions(raw json.RawMessage) ([]greet.GreetOption, error)

DecodeOptions decodes raw Minecraft options into engine GreetOptions.

func FromResult

func FromResult(data greet.LayerData) any

FromResult maps a *minecraft.MinecraftResult to *Data. It returns the input unchanged when data is not a *minecraft.MinecraftResult.

func Register

func Register(c *jsonapi.Codec)

Register registers the Minecraft data mapper and option decoder on the given Codec.

Types

type Data

type Data struct {
	Version    string `json:"version"`
	MOTD       string `json:"motd"`
	Players    int    `json:"players"`
	MaxPlayers int    `json:"maxPlayers"`
}

Data is the JSON-serializable payload for a Minecraft layer.

type Options

type Options struct {
	ProtocolVersion int `json:"protocolVersion"`
}

Options holds JSON-serializable Minecraft layer options.

Jump to

Keyboard shortcuts

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