events

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Started  string = "started"
	Stopped  string = "stopped"
	Starting string = "starting"
	Stopping string = "stopping"
	Saving   string = "saving"
	Saved    string = "saved"
)

State related events that has a direct effect on the wrapper state.

View Source
const (
	Banned           string = "banned"
	BanList          string = "ban-list"
	BanListEntry     string = "ban-list-entry"
	DataGet          string = "data-get"
	DataGetNoEntity  string = "data-get-no-entity"
	DefaultGameMode  string = "default-game-mode"
	Difficulty       string = "difficulty"
	ExperienceAdd    string = "experience-add"
	ExperienceQuery  string = "experience-query"
	Give             string = "give"
	NoPlayerFound    string = "no-player-found"
	PlayerJoined     string = "player-joined"
	PlayerLeft       string = "player-left"
	PlayerUUID       string = "player-uuid"
	PlayerSay        string = "player-say"
	PlayerDied       string = "player-died"
	Kicked           string = "kicked"
	Seed             string = "seed"
	ServerOverloaded string = "server-overloaded"
	TimeIs           string = "time-is"
	UnknownItem      string = "unknown-item"
	Version          string = "version"
	WhisperTo        string = "whisper-to"
)

Game related events that provide player/server related information.

View Source
const (
	Empty string = "empty"
)

Variables

View Source
var (
	NilEvent      = NewStateEvent(Empty)
	StartedEvent  = NewStateEvent(Started)
	StoppedEvent  = NewStateEvent(Stopped)
	StartingEvent = NewStateEvent(Starting)
	StoppingEvent = NewStateEvent(Stopping)
)
View Source
var (
	NilGameEvent       = NewGameEvent(Empty)
	VersionEvent       = NewGameEvent(Version)
	TimeIsEvent        = NewGameEvent(TimeIs)
	DataGetEvent       = NewGameEvent(DataGet)
	NoPlayerFoundEvent = NewGameEvent(NoPlayerFound)
	UnknownItemEvent   = NewGameEvent(UnknownItem)
	PlayerLeftEvent    = NewGameEvent(PlayerLeft)
	PlayerUUIDEvent    = NewGameEvent(PlayerUUID)
)

Functions

This section is empty.

Types

type Event

type Event interface {
	String() string
	Is(Event) bool
}

type EventType

type EventType int
const (
	TypeNil EventType = iota
	TypeState
	TypeCmd
	TypeGame
)

type GameEvent

type GameEvent struct {
	Name string
	Tick int
	Data map[string]string
	// contains filtered or unexported fields
}

func NewGameEvent

func NewGameEvent(e string) GameEvent

func (GameEvent) Is

func (ge GameEvent) Is(e Event) bool

func (GameEvent) String

func (ge GameEvent) String() string

type StateEvent

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

func NewStateEvent

func NewStateEvent(e string) StateEvent

func (StateEvent) Is

func (se StateEvent) Is(ev Event) bool

func (StateEvent) String

func (se StateEvent) String() string

Jump to

Keyboard shortcuts

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