# netcraft-dev/netcraft architecture

> Architecture diagram of the GitHub repository netcraft-dev/netcraft, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/netcraft-dev/netcraft
- Repository: https://github.com/netcraft-dev/netcraft

## Overview

NetCraft is a C# reimplementation of the Minecraft kernel and game layer. A player-facing workflow enters through the client, exchanges protocol packets, and presents the resulting game state; the README also describes a decoupled tick/render model. The repository includes supporting world storage, registries, data formats and upgrades, commands, resources, GPU rendering, and mod loading. Edges reflect README-documented relationships; where the provided excerpts and index do not establish runtime wiring, links are dashed and marked unverified.

Main entry points: [`NetCraft.Game/Bootstrap/GameBootstrap.cs`](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Game/Bootstrap/GameBootstrap.cs) (Game runtime), [`NetCraft.Client/Client/MinecraftClient.cs`](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Client/MinecraftClient.cs) (Client runtime), [`NetCraft.Storage/RegionFileStorage.cs`](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Storage/RegionFileStorage.cs) (Chunk and world storage), [`NetCraft.Client/Gui/ScreenManager.cs`](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Gui/ScreenManager.cs) (Screens and HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client runtime"]
  node_clientapp["Client runtime<br/>[MinecraftClient.cs]"]
  node_screens["Screens and HUD<br/>[ScreenManager.cs]"]
  node_clientnetwork["Client networking<br/>[ClientConnector.cs]"]
  node_packetlisteners["Client packet handling"]
end

subgraph group_world["Game and world"]
  node_gameruntime["Game runtime<br/>[GameBootstrap.cs]"]
  node_worldgen["World generation<br/>[TerrainProvider.cs]"]
  node_worldstorage[("Chunk and world storage")]
  node_light["Lighting engine<br/>[LightEngine.cs]"]
  node_server["Server runtime<br/>[Program.cs]"]
end

subgraph group_kernel["Kernel services"]
  node_registry["Registries<br/>[Registry.cs]"]
  node_nbt["NBT data<br/>[CompoundTag.cs]"]
  node_codec["Codecs<br/>[Codec.cs]"]
  node_datafixer["Data upgrades<br/>[DataFixerUpper.cs]"]
  node_commands["Command dispatch"]
  node_resources["Resource packs<br/>[Pack.cs]"]
end

subgraph group_render["Rendering"]
  node_gpu["GPU and GUI renderer"]
  node_clientworldrender["Client world rendering<br/>[LevelRenderer.cs]"]
end

subgraph group_extension["Extensions"]
  node_modloader["Mod loading<br/>[ModManager.cs]"]
end

node_player(("Player"))

node_player -.->|"uses"| node_screens
node_screens -.->|"interacts with"| node_clientapp
node_clientapp -.->|"connects through"| node_clientnetwork
node_clientnetwork -.->|"dispatches packets"| node_packetlisteners
node_clientapp -.->|"runs game"| node_gameruntime
node_gameruntime -.->|"generates terrain"| node_worldgen
node_gameruntime -->|"uses chunk pipeline"| node_worldstorage
node_worldstorage -.->|"coordinates lighting"| node_light
node_gameruntime -->|"uses registries"| node_registry
node_worldstorage -->|"stores NBT"| node_nbt
node_nbt -->|"bridges with NbtOps"| node_codec
node_worldstorage -->|"upgrades saved data"| node_datafixer
node_gameruntime -->|"provides commands"| node_commands
node_gameruntime -.->|"loads resources"| node_resources
node_clientapp -.->|"renders world"| node_clientworldrender
node_clientworldrender -.->|"submits rendering"| node_gpu
node_screens -->|"renders GUI"| node_gpu
node_clientnetwork -.->|"communicates with"| node_server
node_gameruntime -->|"supports runtime mods"| node_modloader
node_player -.->|"invokes"| node_commands

click node_clientapp "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Client/MinecraftClient.cs"
click node_screens "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Gui/ScreenManager.cs"
click node_clientnetwork "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Network/ClientConnector.cs"
click node_packetlisteners "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Network/Protocol/Game/ClientGamePacketListenerImpl.cs"
click node_gameruntime "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Game/Bootstrap/GameBootstrap.cs"
click node_worldgen "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Game/Data/TerrainProvider.cs"
click node_worldstorage "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Storage/RegionFileStorage.cs"
click node_light "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Storage/Light/LightEngine.cs"
click node_registry "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Registry/Registry.cs"
click node_nbt "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Nbt/CompoundTag.cs"
click node_codec "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Codec/Codec.cs"
click node_datafixer "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.DataFixer/DataFixerUpper.cs"
click node_commands "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Commands/CommandDispatcher.cs"
click node_resources "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Resources/Pack.cs"
click node_gpu "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Gpu/Vulkan/VulkanRenderPipeline.cs"
click node_clientworldrender "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Client/Render/World/LevelRenderer.cs"
click node_modloader "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.ModLoader/ModManager.cs"
click node_server "https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.ServerExe/Program.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_clientapp,node_screens,node_clientnetwork,node_packetlisteners toneBlue
class node_gameruntime,node_worldgen,node_worldstorage,node_light,node_server toneAmber
class node_registry,node_nbt,node_codec,node_datafixer,node_commands,node_resources toneMint
class node_gpu,node_clientworldrender toneRose
class node_modloader,node_player toneIndigo
```

## Components

### Client runtime

- [Client runtime](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Client/MinecraftClient.cs): `NetCraft.Client/Client/MinecraftClient.cs`
- [Screens and HUD](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Gui/ScreenManager.cs): `NetCraft.Client/Gui/ScreenManager.cs`
- [Client networking](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Network/ClientConnector.cs): `NetCraft.Client/Network/ClientConnector.cs`
- [Client packet handling](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Network/Protocol/Game/ClientGamePacketListenerImpl.cs): `NetCraft.Client/Network/Protocol/Game/ClientGamePacketListenerImpl.cs`

### Game and world

- [Game runtime](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Game/Bootstrap/GameBootstrap.cs): `NetCraft.Game/Bootstrap/GameBootstrap.cs`
- [World generation](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Game/Data/TerrainProvider.cs): `NetCraft.Game/Data/TerrainProvider.cs`
- [Chunk and world storage](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Storage/RegionFileStorage.cs): `NetCraft.Storage/RegionFileStorage.cs`
- [Lighting engine](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Storage/Light/LightEngine.cs): `NetCraft.Storage/Light/LightEngine.cs`
- [Server runtime](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.ServerExe/Program.cs): `NetCraft.ServerExe/Program.cs`

### Kernel services

- [Registries](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Registry/Registry.cs): `NetCraft.Registry/Registry.cs`
- [NBT data](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Nbt/CompoundTag.cs): `NetCraft.Nbt/CompoundTag.cs`
- [Codecs](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Codec/Codec.cs): `NetCraft.Codec/Codec.cs`
- [Data upgrades](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.DataFixer/DataFixerUpper.cs): `NetCraft.DataFixer/DataFixerUpper.cs`
- [Command dispatch](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Commands/CommandDispatcher.cs): `NetCraft.Commands/CommandDispatcher.cs`
- [Resource packs](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Resources/Pack.cs): `NetCraft.Resources/Pack.cs`

### Rendering

- [GPU and GUI renderer](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Gpu/Vulkan/VulkanRenderPipeline.cs): `NetCraft.Gpu/Vulkan/VulkanRenderPipeline.cs`
- [Client world rendering](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.Client/Client/Render/World/LevelRenderer.cs): `NetCraft.Client/Client/Render/World/LevelRenderer.cs`

### Extensions

- [Mod loading](https://github.com/netcraft-dev/netcraft/blob/main/NetCraft.ModLoader/ModManager.cs): `NetCraft.ModLoader/ModManager.cs`

### Other components

- **Player**

## Connections

- Player → Screens and HUD: uses
- Screens and HUD → Client runtime: interacts with (evidence: `NetCraft.Client/Gui/ScreenManager.cs`)
- Client runtime → Client networking: connects through
- Client networking → Client packet handling: dispatches packets
- Client runtime → Game runtime: runs game
- Game runtime → World generation: generates terrain
- Game runtime → Chunk and world storage: uses chunk pipeline
- Chunk and world storage → Lighting engine: coordinates lighting
- Game runtime → Registries: uses registries
- Chunk and world storage → NBT data: stores NBT (evidence: `NetCraft.Storage/RegionFileStorage.cs`)
- NBT data → Codecs: bridges with NbtOps (evidence: `NetCraft.Nbt/CompoundTag.cs`)
- Chunk and world storage → Data upgrades: upgrades saved data
- Game runtime → Command dispatch: provides commands
- Game runtime → Resource packs: loads resources
- Client runtime → Client world rendering: renders world
- Client world rendering → GPU and GUI renderer: submits rendering
- Screens and HUD → GPU and GUI renderer: renders GUI
- Client networking → Server runtime: communicates with
- Game runtime → Mod loading: supports runtime mods
- Player → Command dispatch: invokes
