common

package
v1.0.41 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 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 Angle

type Angle float32

type AwardStatistic

type AwardStatistic struct {
	CategoryID  primitive.VarInt
	StatisticID primitive.VarInt
	Value       primitive.VarInt
}

type AwardStatistics

type AwardStatistics []AwardStatistic

type BlockEntity

type BlockEntity struct {
	PackedXZ byte
	Y        int16
	Type     primitive.VarInt
	Data     nbt.NBT
}

type BlockLightArray

type BlockLightArray struct {
	Data []byte
}

type BlockPosition

type BlockPosition uint64

func NewBlockPosition

func NewBlockPosition(x, y, z int32) BlockPosition

func (BlockPosition) GetChunkPosition added in v1.0.29

func (p BlockPosition) GetChunkPosition() *ChunkPosition

func (BlockPosition) X

func (p BlockPosition) X() int32

func (BlockPosition) Y

func (p BlockPosition) Y() int32

func (BlockPosition) Z

func (p BlockPosition) Z() int32

type Chat

type Chat struct {
	*ChatComponent
	Extra []ChatComponent `json:"extra"`
}

type ChatClickEvent

type ChatClickEvent struct {
	OpenURL         string `json:"open_url"`
	OpenFile        string `json:"open_file"`
	RunCommand      string `json:"run_command"`
	TwitchUserInfo  string `json:"twitch_user_info"`
	SuggestCommand  string `json:"suggest_command"`
	ChangePage      string `json:"change_page"`
	CopyToClipboard string `json:"copy_to_clipboard"`
}

type ChatCommandSignature

type ChatCommandSignature struct {
	ArgumentName string
	Signature    []byte
}

type ChatComponent

type ChatComponent struct {
	Text          string         `json:"text"`
	Bold          bool           `json:"bold"`
	Italic        bool           `json:"italic"`
	Underlined    bool           `json:"underlined"`
	Strikethrough bool           `json:"strikethrough"`
	Obfuscated    bool           `json:"obfuscated"`
	Font          string         `json:"font"`
	Color         string         `json:"color"`
	Insertion     string         `json:"insertion"`
	ClickEvent    ChatClickEvent `json:"clickEvent"`
	HoverEvent    ChatHoverEvent `json:"hoverEvent"`
}

type ChatHoverEvent

type ChatHoverEvent struct {
	ShowText        string `json:"show_text"`
	ShowItem        string `json:"show_item"`
	ShowEntity      string `json:"show_entity"`
	ShowAchievement string `json:"show_achievement"`
}

type ChunkPosition added in v1.0.29

type ChunkPosition struct {
	X int32
	Z int32
}

type ChunkSection

type ChunkSection struct {
	BlockCount  uint16
	BlockStates PalettedContainerStructure
	Biomes      PalettedContainerStructure
}

type CommandNode

type CommandNode struct {
	Flags         byte // TODO: Enum
	ChildrenCount primitive.VarInt
	Children      []primitive.VarInt
	RedirectNode  *primitive.VarInt
	Name          *string
	ParserID      *primitive.VarInt
	//Properties    *CommandNodeProperties // TODO: Figure out
	SuggestionsType *primitive.Identifier
}

CommandNode is a node in a command tree. Refer to https://wiki.vg/Command_Data

type DirectPalette

type DirectPalette struct{}

type Hand

type Hand primitive.VarInt
const (
	MainHand Hand = iota
	OffHand
)

type IndirectPalette

type IndirectPalette struct {
	Palette []primitive.VarInt
}

type Palette

type Palette struct {
	SingleValued *SingleValuedPalette
	Indirect     *IndirectPalette
	Direct       *DirectPalette
}

type PalettedContainerStructure

type PalettedContainerStructure struct {
	BitsPerEntry uint8
	Palette      Palette
	DataArray    []int64
}

type PlayerInfoAction

type PlayerInfoAction struct {
	AddPlayer         *PlayerInfoActionAddPlayer
	InitializeChat    *PlayerInfoActionUpdateInitializeChat
	UpdateGameMode    *PlayerInfoActionUpdateGameMode
	UpdateListed      *PlayerInfoActionUpdateListed
	UpdateLatency     *PlayerInfoActionUpdateLatency
	UpdateDisplayName *PlayerInfoActionUpdateDisplayName
}

PlayerInfoAction is a player action. Refer to https://wiki.vg/Protocol#Player_Info_Update

type PlayerInfoActionAddPlayer

type PlayerInfoActionAddPlayer struct {
	Name       string
	Properties []PlayerInfoActionAddPlayerProperty
}

type PlayerInfoActionAddPlayerProperty

type PlayerInfoActionAddPlayerProperty struct {
	Name      string
	Value     string
	IsSigned  bool
	Signature string
}

type PlayerInfoActionUpdateDisplayName

type PlayerInfoActionUpdateDisplayName struct {
	DisplayName *Chat
}

type PlayerInfoActionUpdateGameMode

type PlayerInfoActionUpdateGameMode struct {
	GameMode primitive.VarInt
}

type PlayerInfoActionUpdateInitializeChat

type PlayerInfoActionUpdateInitializeChat struct {
	HasSignatureData    bool
	ChatSessionID       uuid.UUID
	PublicKeyExpiryTime int64
	//EncodedPublicKeySize   primitive.VarInt
	EncodedPublicKey []byte
	//PublicKeySignatureSize primitive.VarInt
	PublicKeySignature []byte
}

type PlayerInfoActionUpdateLatency

type PlayerInfoActionUpdateLatency struct {
	Ping primitive.VarInt
}

type PlayerInfoActionUpdateListed

type PlayerInfoActionUpdateListed struct {
	IsListed bool
}

type PublicKey

type PublicKey struct {
	ExpiresAt          int64
	PublicKeyLength    primitive.VarInt
	PublicKey          []byte
	KeySignatureLength primitive.VarInt
	KeySignature       []byte
}

PublicKey is a struct that represents a public key. Refer to https://wiki.vg/Protocol#Player_Session

type SingleValuedPalette

type SingleValuedPalette struct {
	Value primitive.VarInt
}

type SkyLightArray

type SkyLightArray struct {
	Data []byte
}

type Slot

type Slot struct {
	IsPresent bool
	ItemID    primitive.VarInt
	ItemCount byte
	NBTData   nbt.NBT
}

type SuccessProperty

type SuccessProperty struct {
	Name      string
	Value     string
	IsSigned  bool
	Signature string
}

Jump to

Keyboard shortcuts

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