handler

package
v0.0.0-...-7a55708 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerHandler

type PlayerHandler struct {
	player.NopHandler // Embeds NopHandler to inherit default behavior.
	// contains filtered or unexported fields
}

PlayerHandler handles player-specific events and delegates state updates.

func NewPlayerHandler

func NewPlayerHandler(p *player.Player, s *session.Manager) *PlayerHandler

NewPlayerHandler creates a new PlayerHandler instance for the given player and session manager.

func (*PlayerHandler) HandleMove

func (h *PlayerHandler) HandleMove(ctx *player.Context, newPos mgl64.Vec3, newRot cube.Rotation)

HandleMove is triggered whenever the player moves. It updates the chunk state and triggers any chunk-based logic.

func (*PlayerHandler) HandleQuit

func (h *PlayerHandler) HandleQuit(p *player.Player)

HandleQuit is triggered when the player disconnects from the server. It performs cleanup such as removing state from memory.

Jump to

Keyboard shortcuts

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