# ayanpr/minecraft-purge architecture

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

- Interactive diagram: https://gitdiagram.com/ayanpr/minecraft-purge
- Repository: https://github.com/ayanpr/minecraft-purge

## Overview

Purge is a Bukkit/Purpur server plugin that runs a timed Purge event. Administrators start, end, cancel, or configure the event through commands; the manager drives the announcement and active phases, while event handlers enforce combat and gameplay rules. Immunity requests and grants affect player state and privileges. The README also documents world restrictions, command blocking, cooldowns, configurable messages and sounds, plus optional TAB, LuckPerms, and Minepacks integration. Edges reflect shown calls or README-described behavior; unsampled handler details are represented only where documented.

Main entry points: [`src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt) (Plugin entry and handlers), [`src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt) (Purge orchestration), [`src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt`](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt) (Plugin integrations), [`src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt`](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt) (Command execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Plugin control"]
  node_plugin["Plugin entry and handlers<br/>[Main.kt]"]
  node_commands["Command execution"]
  node_completion["Command suggestions"]
end

subgraph group_event["Purge lifecycle"]
  node_manager["Purge orchestration<br/>[PurgeManager.kt]"]
  node_status["Lifecycle status<br/>[PurgeStatus.kt]"]
  node_bossbars["Countdown bars<br/>[PurgeBossBar.kt]"]
  node_sounds["Purge sounds<br/>[PurgeSound.kt]"]
end

subgraph group_players["Player rules"]
  node_immunity["Immunity policy<br/>[PurgeImmunity.kt]"]
  node_playerstate["Player registry<br/>[PurgePlayer.kt]"]
  node_playerrecord["Player event state"]
end

subgraph group_integrations["Integrations and settings"]
  node_configuration["Purge settings<br/>[PurgeConfig.kt]"]
  node_dependencies["Plugin integrations<br/>[PurgeDependency.kt]"]
  node_messages["Message templates<br/>[messages.yml]"]
  node_configfile["Runtime configuration<br/>[config.yml]"]
end

node_server(("Minecraft server"))
node_admins(("Players and admins"))
node_tab["TAB plugin"]
node_luckperms["LuckPerms"]
node_minepacks["Minepacks"]

node_server -->|"loads plugin"| node_plugin
node_plugin -->|"registers executor"| node_commands
node_plugin -->|"registers completer"| node_completion
node_admins -->|"issues commands"| node_commands
node_commands -->|"dispatches actions"| node_manager
node_commands -->|"changes immunity"| node_immunity
node_manager -->|"updates phase"| node_status
node_manager -.->|"updates countdowns"| node_bossbars
node_manager -->|"plays cues"| node_sounds
node_manager -->|"tracks players"| node_playerstate
node_manager -->|"restores settings"| node_dependencies
node_plugin -->|"checks lifecycle"| node_manager
node_plugin -->|"enforces combat rules"| node_immunity
node_immunity -->|"updates privileges"| node_playerstate
node_playerstate -->|"stores records"| node_playerrecord
node_immunity -->|"applies integrations"| node_dependencies
node_plugin -.->|"loads settings"| node_configuration
node_configuration -.->|"reads values"| node_configfile
node_sounds -->|"gets sound names"| node_configuration
node_plugin -.->|"uses templates"| node_messages
node_dependencies -->|"sets prefix"| node_tab
node_dependencies -->|"changes permissions"| node_luckperms
node_dependencies -->|"changes death drops"| node_minepacks
node_admins -.->|"plays purge"| node_plugin

click node_plugin "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt"
click node_commands "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt"
click node_completion "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeTabCompleter.kt"
click node_manager "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt"
click node_status "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeStatus.kt"
click node_bossbars "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeBossBar.kt"
click node_sounds "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeSound.kt"
click node_immunity "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeImmunity.kt"
click node_playerstate "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayer.kt"
click node_playerrecord "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayerEntity.kt"
click node_configuration "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeConfig.kt"
click node_dependencies "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt"
click node_messages "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/resources/messages.yml"
click node_configfile "https://github.com/ayanpr/minecraft-purge/blob/main/src/main/resources/config.yml"

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_commands,node_completion toneBlue
class node_manager,node_status,node_bossbars,node_sounds toneAmber
class node_immunity,node_playerstate,node_playerrecord,node_server toneMint
class node_configuration,node_dependencies,node_messages,node_configfile toneRose
class node_admins,node_tab,node_luckperms,node_minepacks toneIndigo
```

## Components

### Plugin control

- [Plugin entry and handlers](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`
- [Command execution](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt`
- [Command suggestions](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeTabCompleter.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeTabCompleter.kt`

### Purge lifecycle

- [Purge orchestration](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`
- [Lifecycle status](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeStatus.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeStatus.kt`
- [Countdown bars](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeBossBar.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeBossBar.kt`
- [Purge sounds](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeSound.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeSound.kt`

### Player rules

- [Immunity policy](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeImmunity.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeImmunity.kt`
- [Player registry](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayer.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayer.kt`
- [Player event state](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayerEntity.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayerEntity.kt`

### Integrations and settings

- [Purge settings](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeConfig.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeConfig.kt`
- [Plugin integrations](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt): `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt`
- [Message templates](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/resources/messages.yml): `src/main/resources/messages.yml`
- [Runtime configuration](https://github.com/ayanpr/minecraft-purge/blob/main/src/main/resources/config.yml): `src/main/resources/config.yml`

### Other components

- **Minecraft server**
- **Players and admins**
- **TAB plugin**
- **LuckPerms**
- **Minepacks**

## Connections

- Minecraft server → Plugin entry and handlers: loads plugin (evidence: `README.md`)
- Plugin entry and handlers → Command execution: registers executor (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`)
- Plugin entry and handlers → Command suggestions: registers completer (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`)
- Players and admins → Command execution: issues commands (evidence: `README.md`)
- Command execution → Purge orchestration: dispatches actions (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt`)
- Command execution → Immunity policy: changes immunity (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/command/PurgeCommandExecutor.kt`)
- Purge orchestration → Lifecycle status: updates phase (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`)
- Purge orchestration → Countdown bars: updates countdowns (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`)
- Purge orchestration → Purge sounds: plays cues (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`)
- Purge orchestration → Player registry: tracks players (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`)
- Purge orchestration → Plugin integrations: restores settings (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeManager.kt`)
- Plugin entry and handlers → Purge orchestration: checks lifecycle (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`)
- Plugin entry and handlers → Immunity policy: enforces combat rules (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`)
- Immunity policy → Player registry: updates privileges (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeImmunity.kt`)
- Player registry → Player event state: stores records (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgePlayer.kt`)
- Immunity policy → Plugin integrations: applies integrations (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeImmunity.kt`)
- Plugin entry and handlers → Purge settings: loads settings (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/Main.kt`)
- Purge settings → Runtime configuration: reads values
- Purge sounds → Purge settings: gets sound names (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeSound.kt`)
- Plugin entry and handlers → Message templates: uses templates
- Plugin integrations → TAB plugin: sets prefix (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt`)
- Plugin integrations → LuckPerms: changes permissions (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt`)
- Plugin integrations → Minepacks: changes death drops (evidence: `src/main/kotlin/dev/josantonius/minecraft/purge/PurgeDependency.kt`)
- Players and admins → Plugin entry and handlers: plays purge
