player

package
v0.0.0-...-ed75f63 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler(state, id int32, handler func(*Player, packet.Decodeable) error) struct{}

Types

type Player

type Player struct {
	*net.Conn
	*state.PlayerEntity

	Unlisted bool

	ClientInformation atomic.Pointer[configuration.ClientInformation]
	// contains filtered or unexported fields
}

func (*Player) Dimension

func (p *Player) Dimension() *dimension.Dimension

Dimension returns the dimension struct this player is in

func (*Player) Login

func (p *Player) Login() error

Login logs the player into the game

func (*Player) SynchronizePosition

func (p *Player) SynchronizePosition(x, y, z float64, yaw, pitch float32) error

SynchronizePosition teleports the player to the specified coordinates

func (*Player) SystemMessage

func (p *Player) SystemMessage(msg text.TextComponent) error

SystemMessage sends a system message (unsigned) to the player

func (*Player) ViewDistance

func (p *Player) ViewDistance() int32

ViewDistance returns the view distance of the client, in chunks, or the server's render distance if the client's view distance is bigger or not set

type PlayerList

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

func NewPlayerList

func NewPlayerList(cap uintptr) PlayerList

func (*PlayerList) AddPlayer

func (list *PlayerList) AddPlayer(player *Player)

func (*PlayerList) New

func (list *PlayerList) New(conn *net.Conn, en *state.PlayerEntity, dimensionManager *dimension.DimensionManager, worldLevel *level.Level, serverProperties *properties.ServerProperties, commandManager *command.Manager) *Player

func (*PlayerList) NumPlayers

func (list *PlayerList) NumPlayers() int

func (*PlayerList) Player

func (list *PlayerList) Player(uuid uuid.UUID) *Player

func (*PlayerList) PlayerByUsername

func (list *PlayerList) PlayerByUsername(name string) *Player

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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