player

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSettings = NewSettings(&packet.ClientSettings{
	Locale:       "en_US",
	ViewDistance: 10,
	ChatColors:   true,
	SkinParts:    127,
	MainHand:     1,
})

Functions

This section is empty.

Types

type ChatMode

type ChatMode string
const (
	ShownChatMode ChatMode = "shown"
	CommandsOnly  ChatMode = "commandsOnly"
	Hidden        ChatMode = "hidden"
)

type ChatSession added in v0.22.0

type ChatSession interface {
	SessionID() uuid.UUID // The ID of this chat session.
	crypto.KeyIdentifiable
}

ChatSession represents a chat session helf by a player.

type MainHand

type MainHand string
const (
	LeftMainHand  MainHand = "left"
	RightMainHand MainHand = "right"
)

type Settings

type Settings interface {
	Locale() language.Tag // Locale of the Minecraft client.
	// ViewDistance returns the client's view distance. This does not guarantee the client will see this many
	// chunks, since your servers are responsible for sending the chunks.
	ViewDistance() uint8
	ChatMode() ChatMode   // The chat setting of the client.
	ChatColors() bool     // Whether the client has chat colors disabled.
	SkinParts() SkinParts // The parts of player skin the client will show.
	MainHand() MainHand   // The primary hand of the client.
	// ClientListing returns whether the client explicitly
	// allows listing on the TabList in anonymous tab list mode.
	//
	// This feature was introduced in 1.18.
	ClientListing() bool
}

Settings are the client settings the player gave us.

func NewSettings

func NewSettings(packet *packet.ClientSettings) Settings

type SkinParts

type SkinParts byte

func (SkinParts) Cape

func (bitmask SkinParts) Cape() bool

func (SkinParts) Hat

func (bitmask SkinParts) Hat() bool

func (SkinParts) Jacket

func (bitmask SkinParts) Jacket() bool

func (SkinParts) LeftPants

func (bitmask SkinParts) LeftPants() bool

func (SkinParts) LeftSleeve

func (bitmask SkinParts) LeftSleeve() bool

func (SkinParts) RightPants

func (bitmask SkinParts) RightPants() bool

func (SkinParts) RightSleeve

func (bitmask SkinParts) RightSleeve() bool

Jump to

Keyboard shortcuts

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