# filkond/paperktlib architecture

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

- Interactive diagram: https://gitdiagram.com/filkond/paperktlib
- Repository: https://github.com/filkond/paperktlib

## Overview

paperKtLib is a Kotlin library for Paper/Minecraft plugin developers. The developer-facing workflow is to add the desired modules, use their extensions and configuration APIs in a plugin, and optionally annotate event specifications for KSP-generated Bukkit events. Major capabilities include Adventure text, boss bars, configuration, Paper utilities, Towny extensions, and event generation. Source excerpts show configuration loading and serialization and inventory helpers; README statements establish module use, while unsampled module behavior is represented conservatively.

Main entry points: [`paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers`](https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers) (Config serializers), [`paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt`](https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt) (Event processor), [`paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt`](https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt) (Config manager), [`paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt`](https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt) (Config extensions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Configuration"]
  node_config_api["Config contracts"]
  node_config_element["Config element<br/>[ConfigElement.kt]"]
  node_config_manager["Config manager"]
  node_config_extensions["Config extensions<br/>[ConfigManager.kt]"]
  node_config_serializers["Config serializers"]
  node_config_templates["Config templates"]
end

subgraph group_paper["Paper features"]
  node_inventory["Inventory helpers<br/>[Inventory.kt]"]
  node_itemstack["ItemStack helpers<br/>[ItemStack.kt]"]
  node_paper_events["Paper event helpers<br/>[Event.kt]"]
  node_towny["Towny extensions"]
end

subgraph group_adventure["Text and UI"]
  node_components["Text components<br/>[Component.kt]"]
  node_audience["Audience helpers<br/>[Audience.kt]"]
  node_bossbar["Dynamic boss bars"]
end

subgraph group_events["Event generation"]
  node_event_annotation["Event annotation<br/>[GenerateEvent.kt]"]
  node_event_processor["Event processor"]
  node_processor_provider["Processor provider"]
end

node_developer(("Plugin developer"))
node_plugin["Paper plugin"]
node_paper_api["Paper / Bukkit API"]

node_developer -->|"uses library"| node_plugin
node_plugin -.->|"loads settings"| node_config_extensions
node_config_extensions -->|"creates manager"| node_config_manager
node_config_manager -->|"loads and updates"| node_config_api
node_config_manager -->|"registers config"| node_config_element
node_config_extensions -->|"registers serializers"| node_config_serializers
node_config_templates -->|"uses location serializer"| node_config_serializers
node_config_serializers -->|"uses inventory helpers"| node_inventory
node_config_serializers -->|"uses item helpers"| node_itemstack
node_plugin -->|"uses utilities"| node_inventory
node_plugin -->|"uses extensions"| node_towny
node_plugin -->|"uses text helpers"| node_components
node_plugin -.->|"uses boss bars"| node_bossbar
node_inventory -->|"serializes inventories"| node_paper_api
node_itemstack -->|"edits metadata"| node_paper_api
node_audience -->|"uses components"| node_components
node_bossbar -->|"uses text helpers"| node_components
node_developer -->|"annotates specifications"| node_event_annotation
node_event_annotation -->|"marks event specs"| node_event_processor
node_processor_provider -->|"creates processor"| node_event_processor
node_plugin -->|"runs KSP"| node_event_processor
node_event_processor -->|"generates Bukkit events"| node_paper_api

click node_config_api "https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config"
click node_config_element "https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ConfigElement.kt"
click node_config_manager "https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt"
click node_config_extensions "https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt"
click node_config_serializers "https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers"
click node_config_templates "https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/templates"
click node_inventory "https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Inventory.kt"
click node_itemstack "https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/ItemStack.kt"
click node_paper_events "https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Event.kt"
click node_towny "https://github.com/filkond/paperktlib/tree/master/paperktlib-towny/src/main/kotlin/com/filkond/paperktlib/towny/ext"
click node_components "https://github.com/filkond/paperktlib/blob/master/paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Component.kt"
click node_audience "https://github.com/filkond/paperktlib/blob/master/paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Audience.kt"
click node_bossbar "https://github.com/filkond/paperktlib/blob/master/paperktlib-bossbar/src/main/kotlin/com/filkond/paperktlib/bossbar/SimpleDynamicBossBar.kt"
click node_event_annotation "https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/GenerateEvent.kt"
click node_event_processor "https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt"
click node_processor_provider "https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventProcessorProvider.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_config_api,node_config_element,node_config_manager,node_config_extensions,node_config_serializers,node_config_templates toneBlue
class node_inventory,node_itemstack,node_paper_events,node_towny toneAmber
class node_components,node_audience,node_bossbar,node_paper_api toneMint
class node_event_annotation,node_event_processor,node_processor_provider toneRose
class node_developer,node_plugin toneIndigo
```

## Components

### Configuration

- [Config contracts](https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config`
- [Config element](https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ConfigElement.kt): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ConfigElement.kt`
- [Config manager](https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt`
- [Config extensions](https://github.com/filkond/paperktlib/blob/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt`
- [Config serializers](https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers`
- [Config templates](https://github.com/filkond/paperktlib/tree/master/paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/templates): `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/templates`

### Paper features

- [Inventory helpers](https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Inventory.kt): `paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Inventory.kt`
- [ItemStack helpers](https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/ItemStack.kt): `paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/ItemStack.kt`
- [Paper event helpers](https://github.com/filkond/paperktlib/blob/master/paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Event.kt): `paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Event.kt`
- [Towny extensions](https://github.com/filkond/paperktlib/tree/master/paperktlib-towny/src/main/kotlin/com/filkond/paperktlib/towny/ext): `paperktlib-towny/src/main/kotlin/com/filkond/paperktlib/towny/ext`

### Text and UI

- [Text components](https://github.com/filkond/paperktlib/blob/master/paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Component.kt): `paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Component.kt`
- [Audience helpers](https://github.com/filkond/paperktlib/blob/master/paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Audience.kt): `paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Audience.kt`
- [Dynamic boss bars](https://github.com/filkond/paperktlib/blob/master/paperktlib-bossbar/src/main/kotlin/com/filkond/paperktlib/bossbar/SimpleDynamicBossBar.kt): `paperktlib-bossbar/src/main/kotlin/com/filkond/paperktlib/bossbar/SimpleDynamicBossBar.kt`

### Event generation

- [Event annotation](https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/GenerateEvent.kt): `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/GenerateEvent.kt`
- [Event processor](https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt): `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt`
- [Processor provider](https://github.com/filkond/paperktlib/blob/master/paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventProcessorProvider.kt): `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventProcessorProvider.kt`

### Other components

- **Plugin developer**
- **Paper plugin**
- **Paper / Bukkit API**

## Connections

- Plugin developer → Paper plugin: uses library (evidence: `README.md`)
- Paper plugin → Config extensions: loads settings
- Config extensions → Config manager: creates manager (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt`)
- Config manager → Config contracts: loads and updates (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt`)
- Config manager → Config element: registers config (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/manager/SimpleConfigManager.kt`)
- Config extensions → Config serializers: registers serializers (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/ext/ConfigManager.kt`)
- Config templates → Config serializers: uses location serializer (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/templates/LocationSection.kt`)
- Config serializers → Inventory helpers: uses inventory helpers (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers/InventorySerializer.kt`)
- Config serializers → ItemStack helpers: uses item helpers (evidence: `paperktlib-config/src/main/kotlin/com/filkond/paperktlib/config/serializers/InventorySerializer.kt`)
- Paper plugin → Inventory helpers: uses utilities (evidence: `README.md`)
- Paper plugin → Towny extensions: uses extensions (evidence: `README.md`)
- Paper plugin → Text components: uses text helpers (evidence: `README.md`)
- Paper plugin → Dynamic boss bars: uses boss bars
- Inventory helpers → Paper / Bukkit API: serializes inventories (evidence: `paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/Inventory.kt`)
- ItemStack helpers → Paper / Bukkit API: edits metadata (evidence: `paperktlib-paper/src/main/kotlin/com/filkond/paperktlib/paper/ext/ItemStack.kt`)
- Audience helpers → Text components: uses components (evidence: `paperktlib-adventure/src/main/kotlin/com/filkond/paperktlib/adventure/ext/Audience.kt`)
- Dynamic boss bars → Text components: uses text helpers (evidence: `paperktlib-bossbar/src/main/kotlin/com/filkond/paperktlib/bossbar/SimpleDynamicBossBar.kt`)
- Plugin developer → Event annotation: annotates specifications (evidence: `README.md`)
- Event annotation → Event processor: marks event specs (evidence: `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt`)
- Processor provider → Event processor: creates processor (evidence: `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventProcessorProvider.kt`)
- Paper plugin → Event processor: runs KSP (evidence: `README.md`)
- Event processor → Paper / Bukkit API: generates Bukkit events (evidence: `paperktlib-event-generator/src/main/kotlin/com/filkond/paperktlib/event/ksp/EventSymbolProcessor.kt`)
