# hablethedev/moria architecture

> Architecture diagram of the GitHub repository hablethedev/moria, 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/hablethedev/moria
- Repository: https://github.com/hablethedev/moria

## Overview

Moria is a Paper server plugin providing player and server-information commands plus connection-session tracking. The main flow is plugin enablement configuring logging and registering command executors and player listeners; commands query Bukkit/player state, format results, and send them to command users. The graph preserves documented commands and sampled MSPT/TPS functionality. Some command implementations and wiring are represented only by the SOURCE INDEX, so unsampled relationships are omitted rather than inferred.

Main entry points: [`src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Moria.kt) (Moria plugin), [`src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt`](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt) (Whois command), [`src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt`](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt) (Position command), [`src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt`](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt) (MSPT command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Plugin lifecycle"]
  node_plugin["Moria plugin<br/>[Moria.kt]"]
  node_config["Plugin config<br/>[config.yml]"]
  node_logging["Logging level<br/>[LoggingLevel.kt]"]
end

subgraph group_commands["Information commands"]
  node_moria_cmd["Moria info<br/>[MoriaCommand.kt]"]
  node_ping["Ping command<br/>[PingCommand.kt]"]
  node_position["Position command<br/>[PositionCommand.kt]"]
  node_whois["Whois command<br/>[WhoisCommand.kt]"]
  node_uptime["Uptime command<br/>[UptimeCommand.kt]"]
  node_mspt["MSPT command<br/>[MsptCommand.kt]"]
  node_tps["TPS command<br/>[TpsCommand.kt]"]
  node_permissions["Permission executors"]
  node_tab_permissions["Tab permissions"]
end

subgraph group_helpers["Domain helpers"]
  node_performance["Tick statistics<br/>[Performance.kt]"]
  node_position_helpers["Position formatting<br/>[Position.kt]"]
  node_player_helpers["Player session helper<br/>[Player.kt]"]
  node_time["Time helper<br/>[Time.kt]"]
end

subgraph group_sessions["Session tracking"]
  node_join["Join listener"]
  node_leave["Leave listener"]
end

node_server{{"Paper server"}}
node_user(("Command user"))

node_server -.->|"loads plugin"| node_plugin
node_plugin -->|"reads config"| node_config
node_plugin -->|"selects level"| node_logging
node_plugin -->|"registers"| node_moria_cmd
node_plugin -->|"registers"| node_ping
node_plugin -->|"registers"| node_position
node_plugin -->|"registers"| node_whois
node_plugin -->|"registers"| node_uptime
node_plugin -->|"registers"| node_mspt
node_plugin -->|"registers"| node_tps
node_plugin -->|"wraps command"| node_permissions
node_plugin -->|"wraps command"| node_tab_permissions
node_plugin -->|"registers listener"| node_join
node_plugin -->|"registers listener"| node_leave
node_mspt -->|"calculates statistics"| node_performance
node_position -->|"formats location"| node_position_helpers
node_whois -->|"formats location"| node_position_helpers
node_whois -->|"gets session duration"| node_player_helpers
node_join -->|"records join time"| node_plugin
node_leave -->|"clears join time"| node_plugin
node_player_helpers -->|"reads session state"| node_plugin
node_user -.->|"invokes commands"| node_plugin

click node_plugin "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Moria.kt"
click node_config "https://github.com/hablethedev/moria/blob/master/src/main/resources/config.yml"
click node_logging "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Enum/LoggingLevel.kt"
click node_moria_cmd "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MoriaCommand.kt"
click node_ping "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PingCommand.kt"
click node_position "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt"
click node_whois "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt"
click node_uptime "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/UptimeCommand.kt"
click node_mspt "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt"
click node_tps "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/TpsCommand.kt"
click node_permissions "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionExecutor.kt"
click node_tab_permissions "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionTabExecutor.kt"
click node_performance "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Performance.kt"
click node_position_helpers "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Position.kt"
click node_player_helpers "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Player.kt"
click node_time "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Time.kt"
click node_join "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerJoinListener.kt"
click node_leave "https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerLeaveListener.kt"

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_plugin,node_config,node_logging,node_user toneBlue
class node_moria_cmd,node_ping,node_position,node_whois,node_uptime,node_mspt,node_tps,node_permissions,node_tab_permissions toneAmber
class node_performance,node_position_helpers,node_player_helpers,node_time,node_server toneMint
class node_join,node_leave toneRose
```

## Components

### Plugin lifecycle

- [Moria plugin](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Moria.kt): `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`
- [Plugin config](https://github.com/hablethedev/moria/blob/master/src/main/resources/config.yml): `src/main/resources/config.yml`
- [Logging level](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Enum/LoggingLevel.kt): `src/main/kotlin/dev/legiti/hazel/moria/Enum/LoggingLevel.kt`

### Information commands

- [Moria info](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MoriaCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MoriaCommand.kt`
- [Ping command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PingCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PingCommand.kt`
- [Position command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt`
- [Whois command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt`
- [Uptime command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/UptimeCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/UptimeCommand.kt`
- [MSPT command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt`
- [TPS command](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/TpsCommand.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/TpsCommand.kt`
- [Permission executors](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionExecutor.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionExecutor.kt`
- [Tab permissions](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionTabExecutor.kt): `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PermissionTabExecutor.kt`

### Domain helpers

- [Tick statistics](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Performance.kt): `src/main/kotlin/dev/legiti/hazel/moria/Helper/Performance.kt`
- [Position formatting](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Position.kt): `src/main/kotlin/dev/legiti/hazel/moria/Helper/Position.kt`
- [Player session helper](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Player.kt): `src/main/kotlin/dev/legiti/hazel/moria/Helper/Player.kt`
- [Time helper](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Helper/Time.kt): `src/main/kotlin/dev/legiti/hazel/moria/Helper/Time.kt`

### Session tracking

- [Join listener](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerJoinListener.kt): `src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerJoinListener.kt`
- [Leave listener](https://github.com/hablethedev/moria/blob/master/src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerLeaveListener.kt): `src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerLeaveListener.kt`

### Other components

- **Paper server**
- **Command user**

## Connections

- Paper server → Moria plugin: loads plugin
- Moria plugin → Plugin config: reads config (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Logging level: selects level (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Moria info: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Ping command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Position command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Whois command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Uptime command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → MSPT command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → TPS command: registers (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Permission executors: wraps command (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Tab permissions: wraps command (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Join listener: registers listener (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- Moria plugin → Leave listener: registers listener (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Moria.kt`)
- MSPT command → Tick statistics: calculates statistics (evidence: `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/MsptCommand.kt`)
- Position command → Position formatting: formats location (evidence: `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/PositionCommand.kt`)
- Whois command → Position formatting: formats location (evidence: `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt`)
- Whois command → Player session helper: gets session duration (evidence: `src/main/kotlin/dev/legiti/hazel/moria/CommandExecutor/WhoisCommand.kt`)
- Join listener → Moria plugin: records join time (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerJoinListener.kt`)
- Leave listener → Moria plugin: clears join time (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Listener/PlayerLeaveListener.kt`)
- Player session helper → Moria plugin: reads session state (evidence: `src/main/kotlin/dev/legiti/hazel/moria/Helper/Player.kt`)
- Command user → Moria plugin: invokes commands
