-
Notifications
You must be signed in to change notification settings - Fork 8
Project Structure
el211 edited this page Sep 9, 2026
·
1 revision
GoCraft/
├── bedrock/
│ ├── listener.go # RakNet listener, login, Bedrock play loop
│ └── world/ # Canonical block-hash and sub-chunk encoder
├── config/
│ └── config.go # YAML loading, defaults, and validation
├── core/
│ ├── entity/ # Canonical Entity type and thread-safe registry
│ ├── game/game.go # Edition-neutral player registry + shared entity IDs
│ ├── permission/ # Group/user permission model and manager
│ ├── player/ # Canonical Player model (position, inventory, game mode)
│ ├── spatial/ # Position and rotation types
│ └── world/
│ ├── block.go # Block{Namespace, Name, Properties}
│ ├── chunk.go # Sections, chunks, block entities
│ ├── generator.go # Seeded Overworld/Nether/End terrain generator
│ ├── storage.go # Storage interface (disk / memory)
│ ├── world.go # Concurrent world cache with dirty-chunk tracking
│ └── arch_test.go # Fails build if core/ imports java/
├── customitems/
│ ├── pack.go # Item definition structs
│ ├── registry.go # Persistent CMD / Bedrock runtime ID assignments
│ ├── manager.go # Pack loader — scans packs/, assigns IDs
│ ├── javapack.go # Java resource pack ZIP generator
│ ├── javaserver.go # Embedded HTTP server for Java pack delivery
│ ├── bedrockpack.go # Bedrock .mcaddon generator (RP + BP)
│ └── bedrockitems.go # StartGame ItemEntry list builder
├── java/
│ ├── auth/ # Login crypto, UUIDs, Mojang sessions
│ ├── handler/ # Login/play handlers, commands, recipes, crafting
│ ├── network/ # TCP listener and client connections
│ ├── protocol/ # Framing, packets, VarInts, wire types
│ ├── registry/ # Provider interface + VanillaProvider
│ └── world/
│ ├── anvil/ # Anvil region-file I/O, NBT, atomic saves
│ ├── blocks.go # StateID() accessor
│ ├── items.go # ItemID/ItemName + block-placement helpers
│ ├── chunk.go # Java chunk encoder (PalettedContainer, heightmaps)
│ └── sender.go # Chunk burst sender
├── internal/
│ ├── gamedata/ # go:embed declarations for JSON data files
│ │ └── java/1.21.4/ # blocks.json, registries.json, recipes.json
│ └── protocoldata/ # MustCB/MustSB packet ID resolver
│ └── java/1.21.4/ # Packet ID JSON files per protocol state
├── runtime/ # Native Go plugin runtime (JVM/Go link, supervisor)
├── server/
│ ├── server.go # Core + adapter orchestration
│ ├── chatformat.go # Chat format loader (configuration/chatformat.yml)
│ ├── glyphs.go # Glyph map loader (configuration/glyphs.yml)
│ └── resourcepack.go # Bedrock pack loader (.mcpack / .mcaddon)
├── docs/ # Documentation pages
├── logs/ # Milestone development records
├── main.go # Executable entry point
└── server.yml # Runtime configuration
-
core/is the foundation. It never importsjava/orbedrock/. Edition-specific IDs (Java state IDs, Bedrock runtime IDs) are never stored incore/types — they are resolved only at the adapter boundary. -
java/andbedrock/are peers. Neither imports the other. Each reads canonical state and produces its own native wire format. -
server/is the composition root that wires config + core + adapters into the binary.
The core/world/arch_test.go test fails the build if core/ imports an adapter, keeping the boundary honest. See Architecture and Contributing.
packs/mypacks/items.yml
│
customitems.Load()
├── assigns CMD integers (Java) → packs/.registry.yml (persistent)
├── assigns runtime IDs (Bedrock) → packs/.registry.yml (persistent)
├── BuildJavaPack() → ZIP in memory → HTTP server on :8080
├── BuildBedrockPack() → mcaddon → bedrock/listener pack list
└── BedrockItemEntries() → StartGame.Items (appended to vanilla registry)
GoCraft — native-Go Minecraft server · Java 1.21.4 + Bedrock 1.26.45 cross-play · GPL-3.0 · © 2026 Oreo Studios · Discord
Playing on GoCraft
Server & cross-play
Internals