# xiaoao5297/zenith architecture

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

- Interactive diagram: https://gitdiagram.com/xiaoao5297/zenith
- Repository: https://github.com/xiaoao5297/zenith

## Overview

Zenith is a PocketMine-MP-derived Minecraft server core. Its main user-facing loop is a player connecting to a server, exchanging game packets, and interacting with players, entities, and world state; server operators also issue commands and extend behavior with plugins. The tree shows world generation/storage, gameplay content, crafting, anticheat, and Synapse alongside that loop. Several of these subsystems are only represented by paths or index references here, so their internal links are omitted rather than inferred.

Main entry points: [`src/pocketmine/Server.php`](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Server.php) (Server core), [`src/pocketmine/level/Level.php`](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/level/Level.php) (World levels), [`src/pocketmine/Player.php`](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Player.php) (Player sessions), [`src/pocketmine/entity/Entity.php`](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/entity/Entity.php) (Entity simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_server["Server core<br/>[Server.php]"]
  node_player_session["Player sessions<br/>[Player.php]"]
  node_commands["Command handling<br/>[CommandMap.php]"]
end

subgraph group_network["Networking"]
  node_raklib["RakLib transport<br/>[SessionManager.php]"]
  node_packet_codec["Packet protocol"]
  node_synapse["Synapse integration<br/>[Synapse.php]"]
  node_query["Server query<br/>[QueryHandler.php]"]
end

subgraph group_game["Gameplay"]
  node_world["World levels<br/>[Level.php]"]
  node_chunks["Chunk providers"]
  node_blocks["Block behavior<br/>[Block.php]"]
  node_entities["Entity simulation<br/>[Entity.php]"]
  node_items["Items and recipes<br/>[Item.php]"]
  node_crafting["Crafting recipes"]
end

subgraph group_extension["Extensions"]
  node_events["Event dispatch<br/>[PluginManager.php]"]
  node_plugins["Plugin management<br/>[PluginManager.php]"]
  node_anticheat["Anticheat checks<br/>[AntiCheat.php]"]
end

subgraph group_operations["Operations"]
  node_memory["Memory management<br/>[MemoryManager.php]"]
end

node_players(("Players"))
node_operators(("Operators"))

node_players -.->|"connect to"| node_server
node_operators -.->|"issue commands"| node_commands
node_server -.->|"manages"| node_player_session
node_server -.->|"dispatches"| node_commands
node_server -.->|"loads worlds"| node_world
node_server -.->|"manages"| node_plugins
node_player_session -.->|"interacts with"| node_world
node_raklib -->|"forwards packets"| node_server
node_packet_codec -.->|"translates packets"| node_player_session
node_server -.->|"serves queries"| node_query
node_server -.->|"integrates optionally"| node_synapse
node_world -->|"dispatches events"| node_events
node_entities -->|"reads world state"| node_world
node_entities -->|"dispatches events"| node_events
node_chunks -.->|"provides chunks"| node_world
node_crafting -->|"registers recipes"| node_items
node_memory -.->|"monitors runtime"| node_server
node_anticheat -.->|"checks activity"| node_player_session

click node_server "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Server.php"
click node_player_session "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Player.php"
click node_commands "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/command/CommandMap.php"
click node_events "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/plugin/PluginManager.php"
click node_plugins "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/plugin/PluginManager.php"
click node_anticheat "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/anticheat/AntiCheat.php"
click node_raklib "https://github.com/xiaoao5297/zenith/blob/main/src/raklib/server/SessionManager.php"
click node_packet_codec "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/network/DataPacketManager.php"
click node_synapse "https://github.com/xiaoao5297/zenith/blob/main/src/synapse/Synapse.php"
click node_world "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/level/Level.php"
click node_chunks "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/level/format/LevelProviderManager.php"
click node_blocks "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/block/Block.php"
click node_entities "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/entity/Entity.php"
click node_items "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/item/Item.php"
click node_crafting "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/inventory/CraftingManager.php"
click node_memory "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/MemoryManager.php"
click node_query "https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/network/query/QueryHandler.php"

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_player_session,node_commands toneBlue
class node_raklib,node_packet_codec,node_synapse,node_query toneAmber
class node_world,node_chunks,node_blocks,node_entities,node_items,node_crafting toneMint
class node_events,node_plugins,node_anticheat toneRose
class node_memory,node_players,node_operators toneIndigo
```

## Components

### Server runtime

- [Server core](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Server.php): `src/pocketmine/Server.php`
- [Player sessions](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/Player.php): `src/pocketmine/Player.php`
- [Command handling](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/command/CommandMap.php): `src/pocketmine/command/CommandMap.php`

### Networking

- [RakLib transport](https://github.com/xiaoao5297/zenith/blob/main/src/raklib/server/SessionManager.php): `src/raklib/server/SessionManager.php`
- [Packet protocol](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/network/DataPacketManager.php): `src/pocketmine/network/DataPacketManager.php`
- [Synapse integration](https://github.com/xiaoao5297/zenith/blob/main/src/synapse/Synapse.php): `src/synapse/Synapse.php`
- [Server query](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/network/query/QueryHandler.php): `src/pocketmine/network/query/QueryHandler.php`

### Gameplay

- [World levels](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/level/Level.php): `src/pocketmine/level/Level.php`
- [Chunk providers](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/level/format/LevelProviderManager.php): `src/pocketmine/level/format/LevelProviderManager.php`
- [Block behavior](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/block/Block.php): `src/pocketmine/block/Block.php`
- [Entity simulation](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/entity/Entity.php): `src/pocketmine/entity/Entity.php`
- [Items and recipes](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/item/Item.php): `src/pocketmine/item/Item.php`
- [Crafting recipes](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/inventory/CraftingManager.php): `src/pocketmine/inventory/CraftingManager.php`

### Extensions

- [Event dispatch](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/plugin/PluginManager.php): `src/pocketmine/plugin/PluginManager.php`
- [Plugin management](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/plugin/PluginManager.php): `src/pocketmine/plugin/PluginManager.php`
- [Anticheat checks](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/anticheat/AntiCheat.php): `src/pocketmine/anticheat/AntiCheat.php`

### Operations

- [Memory management](https://github.com/xiaoao5297/zenith/blob/main/src/pocketmine/MemoryManager.php): `src/pocketmine/MemoryManager.php`

### Other components

- **Players**
- **Operators**

## Connections

- Players → Server core: connect to
- Operators → Command handling: issue commands
- Server core → Player sessions: manages (evidence: `src/pocketmine/Server.php`)
- Server core → Command handling: dispatches (evidence: `src/pocketmine/Server.php`)
- Server core → World levels: loads worlds (evidence: `src/pocketmine/Server.php`)
- Server core → Plugin management: manages (evidence: `src/pocketmine/Server.php`)
- Player sessions → World levels: interacts with (evidence: `src/pocketmine/Player.php`)
- RakLib transport → Server core: forwards packets (evidence: `src/raklib/server/SessionManager.php`)
- Packet protocol → Player sessions: translates packets (evidence: `src/pocketmine/network/DataPacketManager.php`)
- Server core → Server query: serves queries (evidence: `src/pocketmine/network/query/QueryHandler.php`)
- Server core → Synapse integration: integrates optionally (evidence: `src/synapse/Synapse.php`)
- World levels → Event dispatch: dispatches events (evidence: `src/pocketmine/level/Level.php`)
- Entity simulation → World levels: reads world state (evidence: `src/pocketmine/entity/Entity.php`)
- Entity simulation → Event dispatch: dispatches events (evidence: `src/pocketmine/entity/Entity.php`)
- Chunk providers → World levels: provides chunks (evidence: `src/pocketmine/level/format/LevelProviderManager.php`)
- Crafting recipes → Items and recipes: registers recipes (evidence: `src/pocketmine/inventory/CraftingManager.php`)
- Memory management → Server core: monitors runtime (evidence: `src/pocketmine/MemoryManager.php`)
- Anticheat checks → Player sessions: checks activity
