Documentation
¶
Index ¶
- Constants
- Variables
- func GetProtocolName(p int) string
- func IsProtocolSupport(p int) bool
- func RegisterCmdEncoder(p CmdPropEncoder) (ok bool)
- func ResloveAddr(target string) (addr *net.TCPAddr, err error)
- func ResloveAddrWithContext(ctx context.Context, target string) (addr *net.TCPAddr, err error)
- func ToNearestProtocol(p int) int
- func UnregisterCmdEncoder(p CmdPropEncoder) (ok bool)
- type AccessData
- type Angle
- type AuthClient
- func (cli *AuthClient) Auth(data AuthData) (res *AuthResponse, err error)
- func (cli *AuthClient) GetPlayerUUID(name string) (_ string, _ uuid.UUID, err error)
- func (cli *AuthClient) Invalidate(data AccessData) (err error)
- func (cli *AuthClient) Refresh(data AccessData) (res *RefreshResponse, err error)
- func (cli *AuthClient) Signout(data LoginData) (err error)
- func (cli *AuthClient) Validate(data AccessData) (err error)
- type AuthData
- type AuthResponse
- type BitSet
- type Bool
- type Byte
- type ByteArray
- type ChunkSection
- type CmdFlag
- type CmdPropEncoder
- type CommandNode
- func (c *CommandNode) DecodeFrom(r *PacketReader) (err error)
- func (c *CommandNode) Encode(b *PacketBuilder)
- func (c *CommandNode) GetParser() (CmdPropEncoder, error)
- func (c *CommandNode) GetParserId() (VarInt, error)
- func (c *CommandNode) GetParserStrId() (String, error)
- func (c *CommandNode) HasFlag(f CmdFlag) bool
- func (c *CommandNode) Type() CmdFlag
- func (c *CommandNode) Vaild() bool
- type Conn
- func (c *Conn) Close() (err error)
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Protocol() int
- func (c *Conn) RawConn() net.Conn
- func (c *Conn) Recv() (r *PacketReader, err error)
- func (c *Conn) RecvHandshakePkt() (pkt *HandshakePkt, err error)
- func (c *Conn) RecvPkt(id int32, pkt Decodable) (err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) Send(p *PacketBuilder) (err error)
- func (c *Conn) SendHandshakePkt(pkt *HandshakePkt) (err error)
- func (c *Conn) SendPkt(id int32, values ...any) (err error)
- type Context
- type Decodable
- type DirectPalette
- type Double
- type EmptyCmdPropEncoder
- type Encodable
- type Float
- type HandshakePkt
- type HttpStatusError
- type Identifier
- type IndirectPalette
- type Int
- type LoginData
- type Long
- type NumRangeProp
- func (p *NumRangeProp[T]) Clear()
- func (p *NumRangeProp[T]) HasMax() bool
- func (p *NumRangeProp[T]) HasMin() bool
- func (p *NumRangeProp[T]) InRange(v T) bool
- func (p *NumRangeProp[T]) Max() T
- func (p *NumRangeProp[T]) Min() T
- func (p *NumRangeProp[T]) SetMax(max T) *NumRangeProp[T]
- func (p *NumRangeProp[T]) SetMin(min T) *NumRangeProp[T]
- type Object
- type Optional
- type Packet
- type PacketBuilder
- func (p *PacketBuilder) Bool(v bool) *PacketBuilder
- func (p *PacketBuilder) Byte(v Byte) *PacketBuilder
- func (p *PacketBuilder) ByteArray(buf []byte) *PacketBuilder
- func (p *PacketBuilder) Bytes() (buf []byte)
- func (p *PacketBuilder) Data() []byte
- func (p *PacketBuilder) Double(v Double) *PacketBuilder
- func (p *PacketBuilder) Encode(v any)
- func (p *PacketBuilder) Float(v Float) *PacketBuilder
- func (p *PacketBuilder) Id() VarInt
- func (p *PacketBuilder) Int(v Int) *PacketBuilder
- func (p *PacketBuilder) JSON(v any) *PacketBuilder
- func (p *PacketBuilder) Len() int
- func (p *PacketBuilder) Long(v Long) *PacketBuilder
- func (p *PacketBuilder) Protocol() int
- func (p *PacketBuilder) Reset(protocol int, id VarInt) *PacketBuilder
- func (p *PacketBuilder) Short(v Short) *PacketBuilder
- func (p *PacketBuilder) String(v String) *PacketBuilder
- func (p *PacketBuilder) UByte(v UByte) *PacketBuilder
- func (p *PacketBuilder) UShort(v UShort) *PacketBuilder
- func (p *PacketBuilder) UUID(v UUID) *PacketBuilder
- func (p *PacketBuilder) VarInt(v VarInt) *PacketBuilder
- func (p *PacketBuilder) VarLong(v VarLong) *PacketBuilder
- func (p *PacketBuilder) WriteTo(w io.Writer) (n int64, err error)
- type PacketReader
- func (p *PacketReader) Bool() (v bool, ok bool)
- func (p *PacketReader) Byte() (v Byte, ok bool)
- func (p *PacketReader) ByteArray(buf []byte) (ok bool)
- func (p *PacketReader) Bytes() []byte
- func (p *PacketReader) Double() (v Double, ok bool)
- func (p *PacketReader) Float() (v Float, ok bool)
- func (p *PacketReader) Id() VarInt
- func (p *PacketReader) Int() (v Int, ok bool)
- func (p *PacketReader) JSON(ptr any) (err error)
- func (p *PacketReader) Long() (v Long, ok bool)
- func (p *PacketReader) Offset() int
- func (p *PacketReader) Protocol() int
- func (p *PacketReader) ReadAll() (buf []byte)
- func (p *PacketReader) Remain() int
- func (p *PacketReader) Short() (v Short, ok bool)
- func (p *PacketReader) String() (v String, ok bool)
- func (p *PacketReader) UByte() (v UByte, ok bool)
- func (p *PacketReader) UShort() (v UShort, ok bool)
- func (p *PacketReader) UUID() (v UUID, ok bool)
- func (p *PacketReader) Uint16() (v uint16, ok bool)
- func (p *PacketReader) Uint32() (v uint32, ok bool)
- func (p *PacketReader) Uint64() (v uint64, ok bool)
- func (p *PacketReader) Uint8() (v uint8, ok bool)
- func (p *PacketReader) VarInt() (v VarInt, ok bool)
- func (p *PacketReader) VarLong() (v VarLong, ok bool)
- type PalettedContainer
- type PingRequestPkt
- type PingResponsePkt
- type PktIdAssertError
- type Position
- type Profile
- type Prop
- type Props
- type RefreshResponse
- type Short
- type SingleValuedPalette
- type StatusRequestPkt
- type StatusResponsePkt
- type String
- type Tag
- type UByte
- type UShort
- type UUID
- type UserData
- type VarInt
- type VarLong
- type YggError
Constants ¶
View Source
const ( NextPingState = 1 NextLoginState = 2 )
View Source
const ( V_UNSET = -1 V_HIGHEST = V1_20 V1_20 = 763 // https://wiki.vg/index.php?title=Protocol&oldid=18256 V1_19_4 = 762 // https://wiki.vg/index.php?title=Protocol&oldid=18242 V1_19_3 = 761 // https://wiki.vg/index.php?title=Protocol&oldid=18067 V1_19_2 = 760 // https://wiki.vg/index.php?title=Protocol&oldid=17873 V1_19 = 759 // https://wiki.vg/index.php?title=Protocol&oldid=17753 V1_18_2 = 758 // https://wiki.vg/index.php?title=Protocol&oldid=17499 V1_18_1 = 757 // https://wiki.vg/index.php?title=Protocol&oldid=17341 V1_17_1 = 756 // https://wiki.vg/index.php?title=Protocol&oldid=16918 V1_17 = 755 // https://wiki.vg/index.php?title=Protocol&oldid=16866 V1_16_5 = 754 // https://wiki.vg/index.php?title=Protocol&oldid=16681 V1_16_3 = 753 // https://wiki.vg/index.php?title=Protocol&oldid=16091 V1_15_2 = 578 // https://wiki.vg/index.php?title=Protocol&oldid=16067 V1_14_4 = 498 // https://wiki.vg/index.php?title=Protocol&oldid=15346 V1_13_2 = 404 // https://wiki.vg/index.php?title=Protocol&oldid=14889 V1_12_2 = 340 // https://wiki.vg/index.php?title=Protocol&oldid=14204 V1_12_1 = 338 // https://wiki.vg/index.php?title=Protocol&oldid=13339 V1_12 = 335 // https://wiki.vg/index.php?title=Protocol&oldid=13223 V1_11_2 = 316 // https://wiki.vg/index.php?title=Protocol&oldid=8543 V1_11 = 315 // https://wiki.vg/index.php?title=Protocol&oldid=8405 V1_10_2 = 210 // https://wiki.vg/index.php?title=Protocol&oldid=8235 V1_9_4 = 110 // https://wiki.vg/index.php?title=Protocol&oldid=7959 V1_8_9 = 47 // https://wiki.vg/index.php?title=Protocol&oldid=7368 V1_7_5 = 4 // https://wiki.vg/index.php?title=Protocol&oldid=5486 V_LOWEST = V1_7_5 )
View Source
const ( DefaultApiServer = "https://api.mojang.com/" DefaultAuthServer = "https://authserver.mojang.com/" DefaultSessionServer = "https://sessionserver.mojang.com/session/minecraft/" )
View Source
const DefaultPort = 25565
Variables ¶
View Source
var ( ErrParserIdNotExists = errors.New("liter.CommandNode: parser id is not exists") ErrParserInstanceNotExists = errors.New("liter.CommandNode: command parser instance not exists") )
View Source
var DefaultAuthClient = &AuthClient{ Client: &http.Client{}, ApiServer: DefaultApiServer, AuthServer: DefaultAuthServer, SessionServer: DefaultSessionServer, }
View Source
var (
ErrOldHandshake = errors.New("Old client(<=1.6) handshake received") // The handshake packet <= 1.6 which first byte is 0xFE
)
View Source
var (
PlayerNotExistsErr = errors.New("Player not exists on the server")
)
View Source
var VarIntTooBig = errors.New("VarInt is too big")
View Source
var VarLongTooBig = errors.New("VarLong is too big")
Functions ¶
func GetProtocolName ¶
func IsProtocolSupport ¶
func RegisterCmdEncoder ¶
func RegisterCmdEncoder(p CmdPropEncoder) (ok bool)
func ResloveAddrWithContext ¶
func ToNearestProtocol ¶
func UnregisterCmdEncoder ¶
func UnregisterCmdEncoder(p CmdPropEncoder) (ok bool)
Types ¶
type AccessData ¶
type AuthClient ¶
type AuthClient struct { Client *http.Client ApiServer string AuthServer string SessionServer string }
func (*AuthClient) Auth ¶
func (cli *AuthClient) Auth(data AuthData) (res *AuthResponse, err error)
func (*AuthClient) GetPlayerUUID ¶
func (*AuthClient) Invalidate ¶
func (cli *AuthClient) Invalidate(data AccessData) (err error)
func (*AuthClient) Refresh ¶
func (cli *AuthClient) Refresh(data AccessData) (res *RefreshResponse, err error)
func (*AuthClient) Signout ¶
func (cli *AuthClient) Signout(data LoginData) (err error)
func (*AuthClient) Validate ¶
func (cli *AuthClient) Validate(data AccessData) (err error)
type AuthResponse ¶
type BitSet ¶
type BitSet []uint64
func NewBitSetWith ¶
func (*BitSet) DecodeFrom ¶
func (s *BitSet) DecodeFrom(r *PacketReader) (err error)
func (BitSet) Encode ¶
func (s BitSet) Encode(p *PacketBuilder)
type ChunkSection ¶
type ChunkSection struct { /* * Number of non-air blocks present in the chunk section. "Non-air" is defined as any fluid and block other than air, cave air, and void air. * The client will keep count of the blocks as they are broken and placed, and, * if the block count reaches 0, the whole chunk section is not rendered, even if it still has blocks. */ BlockCount Short /* Consists of 4096 entries, representing all the blocks in the chunk section */ BlockStates PalettedContainer /* Consists of 64 entries, representing 4x4x4 biome regions in the chunk section */ Biomes PalettedContainer }
func (*ChunkSection) DecodeFrom ¶
func (c *ChunkSection) DecodeFrom(r *PacketReader) (err error)
func (*ChunkSection) Encode ¶
func (c *ChunkSection) Encode(b *PacketBuilder)
type CmdFlag ¶
type CmdFlag Byte
const ( // Values CmdTypeRoot CmdFlag = 0x00 CmdTypeLiteral CmdFlag = 0x01 CmdTypeArg CmdFlag = 0x02 // Masks CmdTypeMask CmdFlag = 0x03 // 0: root, 1: literal, 2: argument. 3 is not used. CmdExec CmdFlag = 0x04 // Set if the node stack to this point constitutes a valid command. CmdRedirect CmdFlag = 0x08 // Set if the node redirects to another node. CmdSuggest CmdFlag = 0x10 // Only present for argument nodes. )
type CmdPropEncoder ¶
type CmdPropEncoder interface { Id() VarInt String() String Encode(b *PacketBuilder, value any) (err error) Decode(r *PacketReader) (value any, err error) }
type CommandNode ¶
type CommandNode struct { Flags CmdFlag Children []VarInt RedirectNode Optional[VarInt] Name Optional[String] ParserId Optional[VarInt] // 1.19+ ParserStrId Optional[String] // 1.7 ~ 1.18 Properties any SuggestionsType Optional[String] }
func (*CommandNode) DecodeFrom ¶
func (c *CommandNode) DecodeFrom(r *PacketReader) (err error)
func (*CommandNode) Encode ¶
func (c *CommandNode) Encode(b *PacketBuilder)
func (*CommandNode) GetParser ¶
func (c *CommandNode) GetParser() (CmdPropEncoder, error)
func (*CommandNode) GetParserId ¶
func (c *CommandNode) GetParserId() (VarInt, error)
func (*CommandNode) GetParserStrId ¶
func (c *CommandNode) GetParserStrId() (String, error)
func (*CommandNode) HasFlag ¶
func (c *CommandNode) HasFlag(f CmdFlag) bool
func (*CommandNode) Type ¶
func (c *CommandNode) Type() CmdFlag
func (*CommandNode) Vaild ¶
func (c *CommandNode) Vaild() bool
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func DialWithContext ¶
func (*Conn) Recv ¶
func (c *Conn) Recv() (r *PacketReader, err error)
func (*Conn) RecvHandshakePkt ¶
func (c *Conn) RecvHandshakePkt() (pkt *HandshakePkt, err error)
func (*Conn) RemoteAddr ¶
func (*Conn) Send ¶
func (c *Conn) Send(p *PacketBuilder) (err error)
func (*Conn) SendHandshakePkt ¶
func (c *Conn) SendHandshakePkt(pkt *HandshakePkt) (err error)
type Decodable ¶
type Decodable interface {
DecodeFrom(r *PacketReader) (err error)
}
type DirectPalette ¶
type DirectPalette struct{}
type EmptyCmdPropEncoder ¶
type EmptyCmdPropEncoder struct {
// contains filtered or unexported fields
}
func NewEmptyCmdPropEncoder ¶
func NewEmptyCmdPropEncoder(id VarInt, sid string) *EmptyCmdPropEncoder
func (*EmptyCmdPropEncoder) Decode ¶
func (p *EmptyCmdPropEncoder) Decode(r *PacketReader) (value any, err error)
func (*EmptyCmdPropEncoder) Encode ¶
func (p *EmptyCmdPropEncoder) Encode(b *PacketBuilder, value any) (err error)
func (*EmptyCmdPropEncoder) Id ¶
func (p *EmptyCmdPropEncoder) Id() VarInt
func (*EmptyCmdPropEncoder) String ¶
func (p *EmptyCmdPropEncoder) String() String
type Encodable ¶
type Encodable interface {
Encode(p *PacketBuilder)
}
type HandshakePkt ¶
It's on purpose that `HandshakePkt` didn't implement `Packet` interface To prevent accidently call with `Conn.SendPkt` or `Conn.RecvPkt` If you want to handle it, please use `Conn.SendHandshakePkt` or `Conn.RecvHandshakePkt` instead
func (*HandshakePkt) Decode ¶
func (p *HandshakePkt) Decode(r *PacketReader) (err error)
func (HandshakePkt) EncodeTo ¶
func (p HandshakePkt) EncodeTo(b *PacketBuilder)
func (HandshakePkt) String ¶
func (p HandshakePkt) String() string
type HttpStatusError ¶
type HttpStatusError struct {
Code int
}
func (*HttpStatusError) Error ¶
func (e *HttpStatusError) Error() string
type Identifier ¶
type Identifier = String
type IndirectPalette ¶
type IndirectPalette struct {
Palette []VarInt
}
type NumRangeProp ¶
type NumRangeProp[T numbers] struct {
// contains filtered or unexported fields
}
func (*NumRangeProp[T]) Clear ¶
func (p *NumRangeProp[T]) Clear()
func (*NumRangeProp[T]) HasMax ¶
func (p *NumRangeProp[T]) HasMax() bool
func (*NumRangeProp[T]) HasMin ¶
func (p *NumRangeProp[T]) HasMin() bool
func (*NumRangeProp[T]) InRange ¶
func (p *NumRangeProp[T]) InRange(v T) bool
func (*NumRangeProp[T]) Max ¶
func (p *NumRangeProp[T]) Max() T
func (*NumRangeProp[T]) Min ¶
func (p *NumRangeProp[T]) Min() T
func (*NumRangeProp[T]) SetMax ¶
func (p *NumRangeProp[T]) SetMax(max T) *NumRangeProp[T]
func (*NumRangeProp[T]) SetMin ¶
func (p *NumRangeProp[T]) SetMin(min T) *NumRangeProp[T]
type PacketBuilder ¶
type PacketBuilder struct {
// contains filtered or unexported fields
}
func NewPacket ¶
func NewPacket(protocol int, id VarInt) (p *PacketBuilder)
func (*PacketBuilder) Bool ¶
func (p *PacketBuilder) Bool(v bool) *PacketBuilder
func (*PacketBuilder) Byte ¶
func (p *PacketBuilder) Byte(v Byte) *PacketBuilder
func (*PacketBuilder) ByteArray ¶
func (p *PacketBuilder) ByteArray(buf []byte) *PacketBuilder
func (*PacketBuilder) Bytes ¶
func (p *PacketBuilder) Bytes() (buf []byte)
func (*PacketBuilder) Data ¶
func (p *PacketBuilder) Data() []byte
func (*PacketBuilder) Double ¶
func (p *PacketBuilder) Double(v Double) *PacketBuilder
func (*PacketBuilder) Encode ¶
func (p *PacketBuilder) Encode(v any)
func (*PacketBuilder) Float ¶
func (p *PacketBuilder) Float(v Float) *PacketBuilder
func (*PacketBuilder) Id ¶
func (p *PacketBuilder) Id() VarInt
func (*PacketBuilder) Int ¶
func (p *PacketBuilder) Int(v Int) *PacketBuilder
func (*PacketBuilder) JSON ¶
func (p *PacketBuilder) JSON(v any) *PacketBuilder
func (*PacketBuilder) Len ¶
func (p *PacketBuilder) Len() int
func (*PacketBuilder) Long ¶
func (p *PacketBuilder) Long(v Long) *PacketBuilder
func (*PacketBuilder) Protocol ¶
func (p *PacketBuilder) Protocol() int
func (*PacketBuilder) Reset ¶
func (p *PacketBuilder) Reset(protocol int, id VarInt) *PacketBuilder
func (*PacketBuilder) Short ¶
func (p *PacketBuilder) Short(v Short) *PacketBuilder
func (*PacketBuilder) String ¶
func (p *PacketBuilder) String(v String) *PacketBuilder
func (*PacketBuilder) UByte ¶
func (p *PacketBuilder) UByte(v UByte) *PacketBuilder
func (*PacketBuilder) UShort ¶
func (p *PacketBuilder) UShort(v UShort) *PacketBuilder
func (*PacketBuilder) UUID ¶
func (p *PacketBuilder) UUID(v UUID) *PacketBuilder
func (*PacketBuilder) VarInt ¶
func (p *PacketBuilder) VarInt(v VarInt) *PacketBuilder
func (*PacketBuilder) VarLong ¶
func (p *PacketBuilder) VarLong(v VarLong) *PacketBuilder
type PacketReader ¶
type PacketReader struct {
// contains filtered or unexported fields
}
func ReadPacket ¶
func ReadPacket(protocol int, r io.Reader) (p *PacketReader, err error)
func ReadPacketFromBytes ¶
func ReadPacketFromBytes(protocol int, buf []byte) (p *PacketReader)
func (*PacketReader) Bool ¶
func (p *PacketReader) Bool() (v bool, ok bool)
func (*PacketReader) Byte ¶
func (p *PacketReader) Byte() (v Byte, ok bool)
func (*PacketReader) ByteArray ¶
func (p *PacketReader) ByteArray(buf []byte) (ok bool)
func (*PacketReader) Bytes ¶
func (p *PacketReader) Bytes() []byte
func (*PacketReader) Double ¶
func (p *PacketReader) Double() (v Double, ok bool)
func (*PacketReader) Float ¶
func (p *PacketReader) Float() (v Float, ok bool)
func (*PacketReader) Id ¶
func (p *PacketReader) Id() VarInt
func (*PacketReader) Int ¶
func (p *PacketReader) Int() (v Int, ok bool)
func (*PacketReader) JSON ¶
func (p *PacketReader) JSON(ptr any) (err error)
func (*PacketReader) Long ¶
func (p *PacketReader) Long() (v Long, ok bool)
func (*PacketReader) Offset ¶
func (p *PacketReader) Offset() int
func (*PacketReader) Protocol ¶
func (p *PacketReader) Protocol() int
func (*PacketReader) ReadAll ¶
func (p *PacketReader) ReadAll() (buf []byte)
func (*PacketReader) Remain ¶
func (p *PacketReader) Remain() int
func (*PacketReader) Short ¶
func (p *PacketReader) Short() (v Short, ok bool)
func (*PacketReader) String ¶
func (p *PacketReader) String() (v String, ok bool)
func (*PacketReader) UByte ¶
func (p *PacketReader) UByte() (v UByte, ok bool)
func (*PacketReader) UShort ¶
func (p *PacketReader) UShort() (v UShort, ok bool)
func (*PacketReader) UUID ¶
func (p *PacketReader) UUID() (v UUID, ok bool)
func (*PacketReader) Uint16 ¶
func (p *PacketReader) Uint16() (v uint16, ok bool)
func (*PacketReader) Uint32 ¶
func (p *PacketReader) Uint32() (v uint32, ok bool)
func (*PacketReader) Uint64 ¶
func (p *PacketReader) Uint64() (v uint64, ok bool)
func (*PacketReader) Uint8 ¶
func (p *PacketReader) Uint8() (v uint8, ok bool)
func (*PacketReader) VarInt ¶
func (p *PacketReader) VarInt() (v VarInt, ok bool)
func (*PacketReader) VarLong ¶
func (p *PacketReader) VarLong() (v VarLong, ok bool)
type PalettedContainer ¶
type PalettedContainer struct { /* * Determines how many bits are used to encode entries. Note that not all numbers are valid here. * Single valued: when bits per entry is equal to 0 * Indirect: * - For block states with bits per entry <= 4, 4 bits are used to represent a block. * - For block states and bits per entry between 5 and 8, the given value is used. * - For biomes the given value is always used, and will be <= 3 * Direct: bits per entry values greater than or equal to a threshold (9 for block states, 4 for biomes). */ BitsPerEntry UByte /* * The bits per entry value determines what format is used for the palette. * In most cases, invalid values will be interpreted as a different value when parsed by the notchian client, * meaning that chunk data will be parsed incorrectly if you use an invalid bits per entry. * Servers must make sure that the bits per entry value is correct. */ Palette any /* Compacted list of indices pointing to entry IDs in the Palette. When Bits Per Entry is 0, this array is empty (see Single valued palette) */ DataArray []Long // contains filtered or unexported fields }
func (*PalettedContainer) DecodeFrom ¶
func (c *PalettedContainer) DecodeFrom(r *PacketReader) (err error)
func (PalettedContainer) Encode ¶
func (c PalettedContainer) Encode(b *PacketBuilder)
type PingRequestPkt ¶
type PingRequestPkt struct {
Payload int64
}
func (*PingRequestPkt) DecodeFrom ¶
func (p *PingRequestPkt) DecodeFrom(r *PacketReader) (err error)
func (PingRequestPkt) Encode ¶
func (p PingRequestPkt) Encode(b *PacketBuilder)
func (PingRequestPkt) String ¶
func (p PingRequestPkt) String() string
type PingResponsePkt ¶
type PingResponsePkt PingRequestPkt
func (*PingResponsePkt) DecodeFrom ¶
func (p *PingResponsePkt) DecodeFrom(r *PacketReader) (err error)
func (PingResponsePkt) Encode ¶
func (p PingResponsePkt) Encode(b *PacketBuilder)
func (PingResponsePkt) String ¶
func (p PingResponsePkt) String() string
type PktIdAssertError ¶
func (*PktIdAssertError) Error ¶
func (e *PktIdAssertError) Error() string
type Position ¶
func PositionFromLong ¶
func (*Position) DecodeFrom ¶
func (p *Position) DecodeFrom(r *PacketReader) (err error)
func (Position) Encode ¶
func (p Position) Encode(b *PacketBuilder)
type RefreshResponse ¶
type SingleValuedPalette ¶
type SingleValuedPalette struct {
Value VarInt
}
type StatusRequestPkt ¶
type StatusRequestPkt struct{}
func (*StatusRequestPkt) DecodeFrom ¶
func (p *StatusRequestPkt) DecodeFrom(r *PacketReader) (err error)
func (StatusRequestPkt) Encode ¶
func (p StatusRequestPkt) Encode(b *PacketBuilder)
func (StatusRequestPkt) String ¶
func (p StatusRequestPkt) String() string
type StatusResponsePkt ¶
type StatusResponsePkt struct {
Payload Object
}
func (*StatusResponsePkt) DecodeFrom ¶
func (p *StatusResponsePkt) DecodeFrom(r *PacketReader) (err error)
func (StatusResponsePkt) Encode ¶
func (p StatusResponsePkt) Encode(b *PacketBuilder)
func (StatusResponsePkt) String ¶
func (p StatusResponsePkt) String() string
type Tag ¶
type Tag struct { }
func (*Tag) DecodeFrom ¶
func (c *Tag) DecodeFrom(r *PacketReader) (err error)
func (Tag) Encode ¶
func (c Tag) Encode(b *PacketBuilder)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmds
|
|
This package provide packet types which used NBT And also the types changed between versions
|
This package provide packet types which used NBT And also the types changed between versions |
Click to show internal directories.
Click to hide internal directories.