protocol

package
v0.0.0-...-4932711 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol int
const (
	ProtocolHandshake Protocol = iota
	ProtocolStatus
	ProtocolLogin
	ProtocolPlay
)

func (Protocol) String

func (p Protocol) String() string

type Registry

type Registry struct {
	Handshake RegistryMap
	Status    RegistryMap
	Login     RegistryMap
	Play      RegistryMap
}
var Reg Registry = Registry{
	Handshake: func() (clientbound map[int32]reflect.Type, serverbound map[int32]reflect.Type) {
		return packet.HandshakeClientboundIds, packet.HandshakeServerboundIds
	},
	Status: func() (clientbound map[int32]reflect.Type, serverbound map[int32]reflect.Type) {
		return packet.StatusClientboundIds, packet.StatusServerboundIds
	},
	Login: func() (clientbound map[int32]reflect.Type, serverbound map[int32]reflect.Type) {
		return packet.LoginClientboundIds, packet.LoginServerboundIds
	},
	Play: func() (clientbound map[int32]reflect.Type, serverbound map[int32]reflect.Type) {
		return packet.PlayClientboundIds, packet.PlayServerboundIds
	},
}

func (*Registry) ClientboundID

func (r *Registry) ClientboundID(t reflect.Type, p Protocol) int32

func (*Registry) ServerboundType

func (r *Registry) ServerboundType(id int32, p Protocol) reflect.Type

type RegistryMap

type RegistryMap func() (clientbound map[int32]reflect.Type, serverbound map[int32]reflect.Type)

Jump to

Keyboard shortcuts

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