# theshovel/irongingot architecture

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

- Interactive diagram: https://gitdiagram.com/theshovel/irongingot
- Repository: https://github.com/theshovel/irongingot

## Overview

irongingot is a low-memory Minecraft 1.21.8 server. A client connects to the server loop, whose packet handling and tick processing drive gameplay and world updates; chunk requests are generated and streamed back to clients. The graph also preserves the documented configuration, persistence, dimensions, structures, crafting, creative mode, and optional Mojang skin capabilities. Relationships use the supplied source index and excerpts; unsampled implementation details are not assumed beyond those references and README statements.

Main entry points: [`src/main.c`](https://github.com/theshovel/irongingot/blob/main/src/main.c) (Server loop), [`src/packets.c`](https://github.com/theshovel/irongingot/blob/main/src/packets.c) (Packet handling), [`src/procedures.c`](https://github.com/theshovel/irongingot/blob/main/src/procedures.c) (Gameplay procedures), [`src/worldgen.c`](https://github.com/theshovel/irongingot/blob/main/src/worldgen.c) (Terrain and dimensions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_connection["Connections and Protocol"]
  node_server["Server loop<br/>[main.c]"]
  node_protocol["Packet handling<br/>[packets.c]"]
  node_wire["Socket and packet I/O<br/>[tools.c]"]
end

subgraph group_gameplay["Gameplay Systems"]
  node_state["Gameplay procedures<br/>[procedures.c]"]
  node_craft["Crafting and smelting<br/>[crafting.c]"]
  node_creative["Creative inventory<br/>[creative_mode.c]"]
  node_blocks["Block interactions<br/>[special_block.c]"]
end

subgraph group_world["World and Chunks"]
  node_worldgen["Terrain and dimensions<br/>[worldgen.c]"]
  node_noise["Perlin noise<br/>[perlin.c]"]
  node_structures["Structures<br/>[structures.c]"]
  node_chunks["Chunk generation and cache<br/>[chunk_generator.c]"]
end

subgraph group_runtime["Runtime Services"]
  node_persistence[("World persistence<br/>[serialize.c]")]
  node_configuration["Server configuration<br/>[config.c]"]
  node_threads["Thread utilities<br/>[async.c]"]
  node_mojang["Mojang skin lookup<br/>[mojang.c]"]
end

node_player(("Minecraft client"))

node_player -->|"connects"| node_server
node_server -->|"serves"| node_player
node_server -->|"dispatches packets"| node_protocol
node_protocol -->|"reads and writes"| node_wire
node_protocol -->|"handles gameplay"| node_state
node_protocol -->|"requests recipes"| node_craft
node_protocol -->|"handles inventory"| node_creative
node_protocol -->|"handles interactions"| node_blocks
node_server -->|"ticks gameplay"| node_state
node_state -->|"queries world"| node_worldgen
node_state -->|"uses structure data"| node_structures
node_state -->|"uses block state"| node_blocks
node_state -->|"saves world"| node_persistence
node_server -->|"streams chunks"| node_chunks
node_chunks -->|"generates terrain"| node_worldgen
node_worldgen -->|"samples noise"| node_noise
node_worldgen -->|"generates structures"| node_structures
node_server -->|"loads settings"| node_configuration
node_server -->|"loads and saves"| node_persistence
node_chunks -->|"uses worker pool"| node_threads
node_server -.->|"fetches skins"| node_mojang

click node_server "https://github.com/theshovel/irongingot/blob/main/src/main.c"
click node_protocol "https://github.com/theshovel/irongingot/blob/main/src/packets.c"
click node_wire "https://github.com/theshovel/irongingot/blob/main/src/tools.c"
click node_state "https://github.com/theshovel/irongingot/blob/main/src/procedures.c"
click node_craft "https://github.com/theshovel/irongingot/blob/main/src/crafting.c"
click node_creative "https://github.com/theshovel/irongingot/blob/main/src/creative_mode.c"
click node_blocks "https://github.com/theshovel/irongingot/blob/main/src/special_block.c"
click node_worldgen "https://github.com/theshovel/irongingot/blob/main/src/worldgen.c"
click node_noise "https://github.com/theshovel/irongingot/blob/main/src/noise/perlin.c"
click node_structures "https://github.com/theshovel/irongingot/blob/main/src/structures.c"
click node_chunks "https://github.com/theshovel/irongingot/blob/main/src/chunk_generator.c"
click node_persistence "https://github.com/theshovel/irongingot/blob/main/src/serialize.c"
click node_configuration "https://github.com/theshovel/irongingot/blob/main/src/config.c"
click node_threads "https://github.com/theshovel/irongingot/blob/main/src/async.c"
click node_mojang "https://github.com/theshovel/irongingot/blob/main/src/mojang.c"

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_server,node_protocol,node_wire,node_player toneBlue
class node_state,node_craft,node_creative,node_blocks toneAmber
class node_worldgen,node_noise,node_structures,node_chunks toneMint
class node_persistence,node_configuration,node_threads,node_mojang toneRose
```

## Components

### Connections and Protocol

- [Server loop](https://github.com/theshovel/irongingot/blob/main/src/main.c): `src/main.c`
- [Packet handling](https://github.com/theshovel/irongingot/blob/main/src/packets.c): `src/packets.c`
- [Socket and packet I/O](https://github.com/theshovel/irongingot/blob/main/src/tools.c): `src/tools.c`

### Gameplay Systems

- [Gameplay procedures](https://github.com/theshovel/irongingot/blob/main/src/procedures.c): `src/procedures.c`
- [Crafting and smelting](https://github.com/theshovel/irongingot/blob/main/src/crafting.c): `src/crafting.c`
- [Creative inventory](https://github.com/theshovel/irongingot/blob/main/src/creative_mode.c): `src/creative_mode.c`
- [Block interactions](https://github.com/theshovel/irongingot/blob/main/src/special_block.c): `src/special_block.c`

### World and Chunks

- [Terrain and dimensions](https://github.com/theshovel/irongingot/blob/main/src/worldgen.c): `src/worldgen.c`
- [Perlin noise](https://github.com/theshovel/irongingot/blob/main/src/noise/perlin.c): `src/noise/perlin.c`
- [Structures](https://github.com/theshovel/irongingot/blob/main/src/structures.c): `src/structures.c`
- [Chunk generation and cache](https://github.com/theshovel/irongingot/blob/main/src/chunk_generator.c): `src/chunk_generator.c`

### Runtime Services

- [World persistence](https://github.com/theshovel/irongingot/blob/main/src/serialize.c): `src/serialize.c`
- [Server configuration](https://github.com/theshovel/irongingot/blob/main/src/config.c): `src/config.c`
- [Thread utilities](https://github.com/theshovel/irongingot/blob/main/src/async.c): `src/async.c`
- [Mojang skin lookup](https://github.com/theshovel/irongingot/blob/main/src/mojang.c): `src/mojang.c`

### Other components

- **Minecraft client**

## Connections

- Minecraft client → Server loop: connects (evidence: `src/main.c`)
- Server loop → Minecraft client: serves (evidence: `README.md`)
- Server loop → Packet handling: dispatches packets (evidence: `src/main.c`)
- Packet handling → Socket and packet I/O: reads and writes (evidence: `src/packets.c`)
- Packet handling → Gameplay procedures: handles gameplay (evidence: `src/packets.c`)
- Packet handling → Crafting and smelting: requests recipes (evidence: `src/packets.c`)
- Packet handling → Creative inventory: handles inventory (evidence: `src/packets.c`)
- Packet handling → Block interactions: handles interactions (evidence: `src/packets.c`)
- Server loop → Gameplay procedures: ticks gameplay (evidence: `src/main.c`)
- Gameplay procedures → Terrain and dimensions: queries world (evidence: `src/procedures.c`)
- Gameplay procedures → Structures: uses structure data (evidence: `src/procedures.c`)
- Gameplay procedures → Block interactions: uses block state (evidence: `src/procedures.c`)
- Gameplay procedures → World persistence: saves world (evidence: `src/procedures.c`)
- Server loop → Chunk generation and cache: streams chunks (evidence: `src/main.c`)
- Chunk generation and cache → Terrain and dimensions: generates terrain (evidence: `src/chunk_generator.c`)
- Terrain and dimensions → Perlin noise: samples noise (evidence: `src/worldgen.c`)
- Terrain and dimensions → Structures: generates structures (evidence: `src/worldgen.c`)
- Server loop → Server configuration: loads settings (evidence: `src/main.c`)
- Server loop → World persistence: loads and saves (evidence: `README.md`)
- Chunk generation and cache → Thread utilities: uses worker pool (evidence: `src/chunk_generator.c`)
- Server loop → Mojang skin lookup: fetches skins (evidence: `README.md`)
