data

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: AGPL-3.0 Imports: 5 Imported by: 23

Documentation

Overview

This package provide packet types which used NBT And also the types changed between versions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEntityEncoder

func RegisterEntityEncoder(p EntityPropEncoder) (ok bool)

func UnregisterEntityEncoder

func UnregisterEntityEncoder(p EntityPropEncoder) (ok bool)

Types

type Direction

type Direction VarInt

Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5

const (
	DirDown  Direction = 0
	DirUp    Direction = 1
	DirNorth Direction = 2
	DirSouth Direction = 3
	DirWest  Direction = 4
	DirEast  Direction = 5
)

func (Direction) String

func (d Direction) String() string

type EntityMetadata

type EntityMetadata struct {
	/* Unique index key determining the meaning of the following value, see the table below.
	 * If this is 0xff then the it is the end of the Entity Metadata array and no more is read.
	 */
	Index UByte
	/* Only if Index is not 0xff; the type of the index, see the table below */
	Type Optional[VarInt]
	/* Only if Index is not 0xff: the value of the metadata field, see the table below */
	Value any
}

func (*EntityMetadata) DecodeFrom

func (c *EntityMetadata) DecodeFrom(r *PacketReader) (err error)

func (EntityMetadata) Encode

func (c EntityMetadata) Encode(b *PacketBuilder)

type EntityPropEncoder

type EntityPropEncoder interface {
	Type() VarInt
	Encode(b *PacketBuilder, value any) (err error)
	Decode(r *PacketReader) (value any, err error)
}

type Rotation

type Rotation struct {
	X, Y, Z Float
}

type Slot

type Slot struct {
	Present   bool
	ItemId    int
	ItemCount Byte
	NBT       nbt.NBT
}

func (*Slot) DecodeFrom

func (c *Slot) DecodeFrom(r *PacketReader) (err error)

func (Slot) Encode

func (c Slot) Encode(b *PacketBuilder)

Jump to

Keyboard shortcuts

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