Versions in this module Expand all Collapse all v1 v1.0.0 Jul 30, 2026 Changes in this version + func HologramCommands(hm *HologramManager) []cmd.Command + func NewMatchID(gameID string) string + func RemoveScoreboard(p *player.Player) + func SendMatchScoreboard(p *player.Player, matchKills int, aliveCount int, chestTimeLeft time.Duration) + func SetPlayerScale(players []*player.Player, remaining int, startMessage string) + type Arena struct + Chests []ChestPosition + MaxPlayers int + Name string + Spawns []mgl64.Vec3 + WorldName string + type ChestPosition struct + Pos mgl64.Vec3 + Type ChestType + type ChestType int + const ChestTypeCenter + const ChestTypeNormal + type Config struct + Database DatabaseConfig + GameSettings map[string]GameConfig + Global GlobalConfig + func DefaultConfig() *Config + type ConfigManager struct + func NewConfigManager(dataDir string, logger *LogWrapper) (*ConfigManager, error) + func (cm *ConfigManager) Config() *Config + func (cm *ConfigManager) GameConfig(gameID string) GameConfig + type Countdown struct + func NewCountdown(seconds int, logger *LogWrapper) *Countdown + func (c *Countdown) Cancel() + func (c *Countdown) IsRunning() bool + func (c *Countdown) OnBroadcast(fn func(msg string)) *Countdown + func (c *Countdown) OnCancel(fn func()) *Countdown + func (c *Countdown) OnComplete(fn func()) *Countdown + func (c *Countdown) Remaining() int + func (c *Countdown) Start() + func (c *Countdown) WithActions(actions ...CountdownAction) *Countdown + type CountdownAction struct + AtSecond int + OnTick func(remaining int) + type DatabaseConfig struct + Path string + Type string + type EndReason string + const EndReasonDraw + const EndReasonForce + const EndReasonLastStanding + const EndReasonTimeLimit + type Framework struct + func New(dataDir string, logger *LogWrapper, blockReg world.BlockRegistry) (*Framework, error) + func (f *Framework) AttachLobbyHandler() + func (f *Framework) Config() *ConfigManager + func (f *Framework) DataFolder() string + func (f *Framework) DiscoverMaps() error + func (f *Framework) Games() *GameManager + func (f *Framework) Holograms() *HologramManager + func (f *Framework) Logger() *LogWrapper + func (f *Framework) Loot() *LootManager + func (f *Framework) Maps() *MapManager + func (f *Framework) Matches() *MatchManager + func (f *Framework) Players() *PlayerManager + func (f *Framework) SetDefaultWorld(w *world.World) + func (f *Framework) SetServer(srv *server.Server) + func (f *Framework) SetupLobby() error + func (f *Framework) Shutdown() + func (f *Framework) Stats() *StatsManager + func (f *Framework) Worlds() *WorldManager + type Game interface + CreateMatch func(id string, arena Arena, players []*player.Player) Match + Description func() string + ID func() string + MaxPlayers func() int + MinPlayers func() int + Name func() string + type GameConfig struct + BackendTaskTicks int + CountdownSeconds int + Enabled bool + GameDurationSeconds int + GracePeriodSeconds int + InvincibilitySeconds int + MaxPlayers int + MinPlayers int + type GameManager struct + func NewGameManager(registry *GameRegistry, matchMgr *MatchManager, worldMgr *WorldManager, ...) *GameManager + func (m *GameManager) JoinGame(p *player.Player, gameID string) error + func (m *GameManager) Registry() *GameRegistry + type GameRegistry struct + func NewGameRegistry() *GameRegistry + func (r *GameRegistry) All() []Game + func (r *GameRegistry) Get(id string) (Game, bool) + func (r *GameRegistry) Register(g Game) error + type GlobalConfig struct + DataSaveInterval int + EnablePvP bool + JoinCommand string + Language string + LeaveCommand string + PluginPrefix string + type Hologram struct + Lines []string + UUID string + World string + X float64 + Y float64 + Z float64 + type HologramManager struct + func NewHologramManager(dataDir string, logger *LogWrapper) *HologramManager + func (hm *HologramManager) All() map[string]*Hologram + func (hm *HologramManager) Create(name string, pos mgl64.Vec3, lines []string) (*Hologram, error) + func (hm *HologramManager) Delete(name string) + func (hm *HologramManager) Get(name string) (*Hologram, bool) + func (hm *HologramManager) MoveTo(name string, pos mgl64.Vec3) error + func (hm *HologramManager) SetLines(name string, lines []string) error + func (hm *HologramManager) SetLobbyWorld(w *world.World) + type LobbySpawn struct + Pitch float64 + Position mgl64.Vec3 + Yaw float64 + type LogWrapper struct + func NewLogWrapper(logger *slog.Logger) *LogWrapper + type LootEnchantment struct + ID string + Level int + type LootEntry struct + AmountMax int + AmountMin int + Chance float64 + Enchantments []LootEnchantment + Item string + type LootManager struct + func NewLootManager(dataDir string, logger *LogWrapper) (*LootManager, error) + func (lm *LootManager) GenerateLoot(tableName string) []map[string]int + type LootTable struct + Entries []LootEntry + MaxRolls int + MinRolls int + type MapManager struct + func NewMapManager(dataDir string, logger *LogWrapper, blockReg world.BlockRegistry) *MapManager + func (mm *MapManager) ArenaByName(name string) (Arena, bool) + func (mm *MapManager) Arenas() []Arena + func (mm *MapManager) DiscoverMaps(gameID string) error + func (mm *MapManager) SelectArena(gameID string) (Arena, error) + type Match interface + AddPlayer func(p *player.Player) error + Alive func() []*player.Player + Done func() <-chan struct{} + GameID func() string + ID func() string + Players func() []*player.Player + Start func() + State func() MatchState + type MatchManager struct + func NewMatchManager(worldMgr *WorldManager, logger *LogWrapper) *MatchManager + func (m *MatchManager) FindSuitableMatch(gameID string, maxPlayers int) Match + func (m *MatchManager) Get(id string) (Match, bool) + func (m *MatchManager) MatchByPlayer(p *player.Player) (Match, bool) + func (m *MatchManager) Register(match Match) + func (m *MatchManager) Shutdown() + func (m *MatchManager) Unregister(id string) + type MatchState int + const MatchStateClosed + const MatchStateCountdown + const MatchStateFinished + const MatchStatePlaying + const MatchStateStarting + const MatchStateWaiting + func (s MatchState) String() string + type PlayerManager struct + func NewPlayerManager(dataDir string, logger *LogWrapper) *PlayerManager + func (pm *PlayerManager) AddPlayer(p *player.Player, matchID string) + func (pm *PlayerManager) IncrementKills(p *player.Player) + func (pm *PlayerManager) IsInMatch(p *player.Player) bool + func (pm *PlayerManager) LobbySpawn() LobbySpawn + func (pm *PlayerManager) PlayerState(p *player.Player) (*PlayerState, bool) + func (pm *PlayerManager) RemoveAllFromMatch(matchID string) + func (pm *PlayerManager) RemovePlayer(p *player.Player) + func (pm *PlayerManager) ReturnToLobby(p *player.Player) + func (pm *PlayerManager) SendLobbyScoreboard(p *player.Player) + func (pm *PlayerManager) SetDead(p *player.Player) + func (pm *PlayerManager) SetLobbyWorld(w *world.World) + func (pm *PlayerManager) SetServer(srv *server.Server) + func (pm *PlayerManager) SetSpawn(pos mgl64.Vec3, yaw, pitch float64) + func (pm *PlayerManager) SetSpectating(p *player.Player) + func (pm *PlayerManager) SetStatsManager(sm *StatsManager) + type PlayerState struct + Deaths int + IsAlive bool + IsSpectating bool + Kills int + MatchID string + Player *player.Player + type PlayerStats struct + Deaths int + Games int + Kills int + Wins int + type RemoveReason string + const RemoveReasonDeath + const RemoveReasonKicked + const RemoveReasonQuit + const RemoveReasonTransfer + type SpectatorManager struct + func NewSpectatorManager(logger *LogWrapper) *SpectatorManager + func (sm *SpectatorManager) CycleSpectatorTarget(p *player.Player, alive []*player.Player) + func (sm *SpectatorManager) DisableSpectator(p *player.Player) + func (sm *SpectatorManager) EnableSpectator(p *player.Player) + type StatsManager struct + func NewStatsManager(dataDir string, logger *LogWrapper) (*StatsManager, error) + func (sm *StatsManager) IncrementDeaths(uuid uuid.UUID) + func (sm *StatsManager) IncrementGames(uuid uuid.UUID) + func (sm *StatsManager) IncrementKills(uuid uuid.UUID) + func (sm *StatsManager) IncrementWins(uuid uuid.UUID) + func (sm *StatsManager) LoadPlayerStats(uuid uuid.UUID) *PlayerStats + func (sm *StatsManager) SavePlayerStats(uuid uuid.UUID, stats *PlayerStats) error + type WorldHandler interface + HandleChestLoot func(tx *world.Tx, pos mgl64.Vec3, chestType ChestType) + type WorldManager struct + func NewWorldManager(dataDir string, logger *LogWrapper, reg world.BlockRegistry) *WorldManager + func (wm *WorldManager) AcquireWorld(arena Arena) (*world.World, error) + func (wm *WorldManager) CreateWorld(dir string) (*world.World, error) + func (wm *WorldManager) OpenWorld(dir string) (*world.World, error) + func (wm *WorldManager) ReturnWorld(worldName string) + func (wm *WorldManager) Shutdown() + type WorldPool struct + func NewWorldPool(dir string, maxIdle int, reg world.BlockRegistry, logger *LogWrapper) *WorldPool + func (p *WorldPool) Acquire(templateDir string, arena Arena) (*world.World, error) + func (p *WorldPool) Preload(templateDir string, arena Arena, count int) error + func (p *WorldPool) Release(w *world.World, reset bool) + func (p *WorldPool) Shutdown()