1.8 KiB
1.8 KiB
Tarna Minecraft Bedrock Server / Dragonfly
Run
go run main.go— start server (usesconfig.toml; auto-created if missing)go build -o mc_server main.go && ./mc_server— build + runmake lint— rungolangci-lintwithgovet,staticcheck,ineffassign,gocriticgo test ./...— all tests (only 2 test files exist; deterministic world tests useworld.Config{Synchronous: true})- CI runs
make lintthengo test ./...on every PR/push
Architecture
main.go— entry point; adds custom mob spawner (every 20s), item cleaner (every 15min), cooperative random spawn, admin-only commands (2 hardcoded admins)server/— the Dragonfly library:server.go(core),conf.go(config),session/(network protocol),cmd/(command framework),block/,entity/,world/(world + generators + LevelDB storage)cmd/blockhash/— standalone utility for block hash generationconfig.toml— runtime config (TOML); network address, world folder, chunk radius, resource packs, etc.
Code conventions
- Module:
github.com/df-mc/dragonfly(Go 1.26) - British English in docs, symbols, variables
gofmtformatting; 3+ sequential vars grouped intovar()block- Minimize exported symbols; conservative use of generics
eol=lffor all.gofiles (.gitattributes)
Generated files (DO NOT EDIT)
server/session/enchantment_texts.go— autogenerated by CI from GitHub contributor list
Deploy (push to master only)
- Builds binary → SCPs to VPS → stops old server via
screen→ starts new binary inscreen -S dragonfly - PRs deploy test server to
df-mc.dev/pullrequest/<PR#>for review
Data / runtime
- World data stored in
world/, player data inplayers/, resource packs inresources/(all gitignored) bans.jsonfor multi-factor ban system by username/XUID/UUID/IP