Documentation ¶
Index ¶
- Constants
- func DefaultJsonCodec() codec.Codec
- func JsonCodec(protocol proto.Protocol) codec.Codec
- func LatestJsonCodec() codec.Codec
- func ReadBool(reader io.Reader) (val bool, err error)
- func ReadByte(reader io.Reader) (val byte, err error)
- func ReadBytes(rd io.Reader) ([]byte, error)
- func ReadBytes17(rd io.Reader) ([]byte, error)
- func ReadBytesLen(rd io.Reader, maxLength int) (bytes []byte, err error)
- func ReadExtendedForgeShort(rd io.Reader) (int, error)
- func ReadFloat32(reader io.Reader) (val float32, err error)
- func ReadFloat64(reader io.Reader) (val float64, err error)
- func ReadInt(rd io.Reader) (int, error)
- func ReadInt16(reader io.Reader) (val int16, err error)
- func ReadInt32(reader io.Reader) (val int32, err error)
- func ReadInt64(reader io.Reader) (val int64, err error)
- func ReadInt8(reader io.Reader) (val int8, err error)
- func ReadIntArray(rd io.Reader) ([]int, error)
- func ReadProperties(rd io.Reader) (props []profile.Property, err error)
- func ReadRawBytes(rd io.Reader) ([]byte, error)
- func ReadString(rd io.Reader) (string, error)
- func ReadStringArray(rd io.Reader) ([]string, error)
- func ReadStringMax(rd io.Reader, max int) (string, error)
- func ReadStringWithoutLen(rd io.Reader) (string, error)
- func ReadUTF(rd io.Reader) (string, error)
- func ReadUUID(rd io.Reader) (id uuid.UUID, err error)
- func ReadUint16(reader io.Reader) (val uint16, err error)
- func ReadUint32(reader io.Reader) (val uint32, err error)
- func ReadUint64(reader io.Reader) (val uint64, err error)
- func ReadUint8(reader io.Reader) (val uint8, err error)
- func ReadVarInt(r io.Reader) (result int, err error)
- func WriteBool(writer io.Writer, val bool) (err error)
- func WriteByte(writer io.Writer, val byte) (err error)
- func WriteBytes(wr io.Writer, b []byte) (err error)
- func WriteBytes17(wr io.Writer, b []byte, allowExtended bool) error
- func WriteExtendedForgeShort(wr io.Writer, toWrite int) (err error)
- func WriteFloat32(writer io.Writer, val float32) (err error)
- func WriteFloat64(writer io.Writer, val float64) (err error)
- func WriteInt(writer io.Writer, val int) (err error)
- func WriteInt16(writer io.Writer, val int16) (err error)
- func WriteInt32(writer io.Writer, val int32) (err error)
- func WriteInt64(writer io.Writer, val int64) (err error)
- func WriteInt8(writer io.Writer, val int8) (err error)
- func WriteProperties(wr io.Writer, properties []profile.Property) error
- func WriteRawBytes(wr io.Writer, b []byte) (err error)
- func WriteString(writer io.Writer, val string) (err error)
- func WriteStrings(wr io.Writer, a []string) error
- func WriteUTF(wr io.Writer, s string) error
- func WriteUUID(wr io.Writer, uuid uuid.UUID) error
- func WriteUint16(writer io.Writer, val uint16) (err error)
- func WriteUint32(writer io.Writer, val uint32) (err error)
- func WriteUint64(writer io.Writer, val uint64) (err error)
- func WriteUint8(writer io.Writer, val uint8) (err error)
- func WriteVarInt(writer io.Writer, val int) (err error)
- type NBT
- func (b NBT) Bool(name string) (bool, bool)
- func (b NBT) ByteArray(name string) (ret []byte, ok bool)
- func (b NBT) Float32(name string) (ret float32, ok bool)
- func (b NBT) Float64(name string) (ret float64, ok bool)
- func (b NBT) Int(name string) (int, bool)
- func (b NBT) Int16(name string) (ret int16, ok bool)
- func (b NBT) Int32(name string) (ret int32, ok bool)
- func (b NBT) Int32Array(name string) (ret []int32, ok bool)
- func (b NBT) Int64(name string) (ret int64, ok bool)
- func (b NBT) Int64Array(name string) (ret []int64, ok bool)
- func (b NBT) Int8(name string) (ret int8, ok bool)
- func (b NBT) List(name string) (ret []NBT, ok bool)
- func (b NBT) NBT(name string) (ret NBT, ok bool)
- func (b NBT) String(name string) (ret string, ok bool)
- func (b NBT) Uint8(name string) (ret uint8, ok bool)
Constants ¶
const ForgeMaxArrayLength = math.MaxInt32 & 0x1FFF9A
Variables ¶
This section is empty.
Functions ¶
func DefaultJsonCodec ¶
DefaultJsonCodec returns a legacy supportive codec.
func JsonCodec ¶
JsonCodec returns the appropriate codec for the given protocol version. This is used to constrain messages sent to older clients.
func LatestJsonCodec ¶
func ReadBytes17 ¶
ReadBytes17 reads bytes with the Minecraft 1.7 style length.
func ReadExtendedForgeShort ¶
ReadExtendedForgeShort reads a Minecraft-style extended short from the specified {@code buf}.
func ReadRawBytes ¶ added in v0.15.1
Reads a non length prefixed string from the reader. This is necessary for parsing certain packets like the velocity login/hello packet (no length prefix).
func ReadStringWithoutLen ¶
ReadStringWithoutLen reads a non length-prefixed string from the Reader. We need this for the legacy 1.7 version, being inconsistent when sending the plugin message channel brand.
func WriteRawBytes ¶ added in v0.15.1
Writes a raw strema of bytes to a file with no length prefix. Necessary for the Velocity hello/login packet (it uses a non-standard packet format)