types

package
v0.0.0-...-a5005bf Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SegmentBits = 0x7F
	ContinueBit = 0x80
)

Variables

This section is empty.

Functions

func GetVarIntSize

func GetVarIntSize(value int) int

func ReadBool

func ReadBool(reader io.Reader) (bool, error)

func ReadByte

func ReadByte(reader io.Reader) (byte, error)

func ReadByteArray

func ReadByteArray(reader io.Reader) ([]byte, error)

func ReadBytes

func ReadBytes(reader io.Reader, n int) ([]byte, error)

func ReadFloat32

func ReadFloat32(reader io.Reader) (float32, error)

func ReadFloat64

func ReadFloat64(reader io.Reader) (float64, error)

func ReadInt16

func ReadInt16(reader io.Reader) (int16, error)

func ReadInt32

func ReadInt32(reader io.Reader) (int32, error)

func ReadInt64

func ReadInt64(reader io.Reader) (int64, error)

func ReadNBT

func ReadNBT(reader io.Reader, blueprint any) (any, error)

func ReadString

func ReadString(reader io.Reader) (string, error)

func ReadVarInt

func ReadVarInt(reader io.Reader) (int, error)

func ReadVarLong

func ReadVarLong(reader io.Reader) (int64, error)

func WriteBitSet

func WriteBitSet(writer io.Writer, bitSet *BitSet) error

func WriteBool

func WriteBool(writer io.Writer, value bool) error

func WriteByte

func WriteByte(writer io.Writer, value byte) error

func WriteByteArray

func WriteByteArray(writer io.Writer, value []byte) error

func WriteFloat32

func WriteFloat32(writer io.Writer, value float32) error

func WriteFloat64

func WriteFloat64(writer io.Writer, value float64) error

func WriteInt16

func WriteInt16(writer io.Writer, value int16) error

func WriteInt32

func WriteInt32(writer io.Writer, value int32) error

func WriteInt64

func WriteInt64(writer io.Writer, value int64) error

func WriteNBT

func WriteNBT(writer io.Writer, obj any) error

func WritePosition

func WritePosition(writer io.Writer, position *Position) error

func WriteSlot

func WriteSlot(writer io.Writer, slot *SlotData) error

func WriteString

func WriteString(writer io.Writer, value string) error

func WriteUUID

func WriteUUID(writer io.Writer, value UUID) error

func WriteVarInt

func WriteVarInt(writer io.Writer, value int) error

func WriteVarLong

func WriteVarLong(writer io.Writer, value int64) error

Types

type BitSet

type BitSet struct {
	// contains filtered or unexported fields
}

func NewBitSet

func NewBitSet(bits int) *BitSet

func ReadBitSet

func ReadBitSet(reader io.Reader) (BitSet, error)

func (*BitSet) BitsSet

func (b *BitSet) BitsSet() int

func (*BitSet) Set0

func (b *BitSet) Set0(n int)

func (*BitSet) Set1

func (b *BitSet) Set1(n int)

func (*BitSet) Value

func (b *BitSet) Value(n int) bool

type Position

type Position struct {
	X int
	Y int
	Z int
}

func NewPosition

func NewPosition(x, y, z int) *Position

func PositionFromInt64

func PositionFromInt64(value int64) Position

func ReadPosition

func ReadPosition(reader io.Reader) (Position, error)

func (Position) ToInt64

func (p Position) ToInt64() int64

type SlotData

type SlotData struct {
	Present   bool
	ItemID    int
	ItemCount byte
	NBT       *nbt.RawMessage
}

func ReadSlot

func ReadSlot(reader io.Reader) (slot SlotData, err error)

type UUID

type UUID struct {
	Upper int64
	Lower int64
}

func GetRandomUUID

func GetRandomUUID() UUID

func ReadUUID

func ReadUUID(reader io.Reader) (UUID, error)

Jump to

Keyboard shortcuts

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