# syrql/customgiantkoth architecture

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

- Interactive diagram: https://gitdiagram.com/syrql/customgiantkoth
- Repository: https://github.com/syrql/customgiantkoth

## Overview

Giant KOTH is a Bukkit/Factions plugin for configuring and running point-based King of the Hill events. An administrator creates an event and its regions, starts it, and the scheduled task tracks faction presence and capture points until time expires or a faction reaches the target; event completion applies configured rank rewards. The graph also shows death penalties, persistence, and PlaceholderAPI output. Source excerpts support the main runtime calls; some setup and integrations are connected only where the README or source index documents them.

Main entry points: [`src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java) (Points manager), [`src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java) (Plugin lifecycle), [`src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java) (Capture task), [`src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java`](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java) (Placeholders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin runtime"]
  node_plugin["Plugin lifecycle"]
  node_placeholder["Placeholders"]
end

subgraph group_events["KOTH events"]
  node_command["KOTH commands"]
  node_eventdata["KOTH event state"]
  node_area["Capture regions<br/>[Area.java]"]
  node_cuboid["Region geometry<br/>[Cuboid.java]"]
  node_task["Capture task"]
end

subgraph group_points["Faction scoring"]
  node_manager["Points manager"]
  node_listener["Death penalty"]
  node_factionpoints["Faction points<br/>[FactionPoints.java]"]
  node_comparator["Points ordering"]
  node_ranking["Reward ranks<br/>[Ranking.java]"]
end

subgraph group_persistence["Configuration and storage"]
  node_config["Plugin config<br/>[ConfigFile.java]"]
  node_provider["KOTH provider"]
  node_jsonfiles[("Event JSON files")]
end

node_admin(("Server admin"))
node_factions["Factions plugin"]
node_placeholderapi["PlaceholderAPI"]

node_admin -->|"manages events"| node_command
node_plugin -->|"loads config"| node_config
node_plugin -->|"registers"| node_command
node_plugin -->|"initializes"| node_manager
node_plugin -->|"schedules"| node_task
node_plugin -.->|"registers optionally"| node_placeholder
node_command -->|"reads and changes"| node_provider
node_command -->|"starts and configures"| node_eventdata
node_command -->|"reads messages"| node_config
node_manager -->|"loads and saves"| node_provider
node_manager -->|"registers"| node_listener
node_manager -->|"loads rewards"| node_config
node_manager -->|"sorts points"| node_comparator
node_manager -->|"builds rewards"| node_ranking
node_provider -->|"loads and stores"| node_eventdata
node_provider -->|"reads and writes"| node_jsonfiles
node_eventdata -->|"creates regions"| node_area
node_area -->|"builds bounds"| node_cuboid
node_task -->|"gets active events"| node_provider
node_task -->|"updates event state"| node_eventdata
node_task -->|"awards capture points"| node_factionpoints
node_task -->|"checks faction players"| node_factions
node_listener -->|"reduces death points"| node_factionpoints
node_listener -->|"identifies faction"| node_factions
node_eventdata -->|"ranks winners"| node_manager
node_placeholder -->|"reads event scores"| node_manager
node_placeholder -->|"looks up player faction"| node_factions
node_placeholder -->|"sorts capper ranks"| node_comparator
node_placeholderapi -->|"requests values"| node_placeholder

click node_plugin "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java"
click node_config "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/config/ConfigFile.java"
click node_command "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java"
click node_manager "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java"
click node_provider "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/provider/KothPointsProvider.java"
click node_eventdata "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/data/KothPointsData.java"
click node_area "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/area/Area.java"
click node_cuboid "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/utils/cuboid/Cuboid.java"
click node_task "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java"
click node_listener "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/listener/KothPointsListener.java"
click node_factionpoints "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/data/FactionPoints.java"
click node_comparator "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/comparator/FactionPointsComparator.java"
click node_ranking "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/ranking/Ranking.java"
click node_placeholder "https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java"

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_placeholder toneBlue
class node_command,node_eventdata,node_area,node_cuboid,node_task toneAmber
class node_manager,node_listener,node_factionpoints,node_comparator,node_ranking,node_admin,node_placeholderapi toneMint
class node_config,node_provider,node_jsonfiles toneRose
class node_factions toneIndigo
```

## Components

### Plugin runtime

- [Plugin lifecycle](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java): `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`
- [Placeholders](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java): `src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java`

### KOTH events

- [KOTH commands](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java): `src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java`
- [KOTH event state](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/data/KothPointsData.java): `src/main/java/fr/syrql/giantkoth/data/KothPointsData.java`
- [Capture regions](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/area/Area.java): `src/main/java/fr/syrql/giantkoth/area/Area.java`
- [Region geometry](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/utils/cuboid/Cuboid.java): `src/main/java/fr/syrql/giantkoth/utils/cuboid/Cuboid.java`
- [Capture task](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java): `src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`

### Faction scoring

- [Points manager](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java): `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`
- [Death penalty](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/listener/KothPointsListener.java): `src/main/java/fr/syrql/giantkoth/listener/KothPointsListener.java`
- [Faction points](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/data/FactionPoints.java): `src/main/java/fr/syrql/giantkoth/data/FactionPoints.java`
- [Points ordering](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/comparator/FactionPointsComparator.java): `src/main/java/fr/syrql/giantkoth/comparator/FactionPointsComparator.java`
- [Reward ranks](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/ranking/Ranking.java): `src/main/java/fr/syrql/giantkoth/ranking/Ranking.java`

### Configuration and storage

- [Plugin config](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/config/ConfigFile.java): `src/main/java/fr/syrql/giantkoth/config/ConfigFile.java`
- [KOTH provider](https://github.com/syrql/customgiantkoth/blob/master/src/main/java/fr/syrql/giantkoth/provider/KothPointsProvider.java): `src/main/java/fr/syrql/giantkoth/provider/KothPointsProvider.java`
- **Event JSON files**

### Other components

- **Server admin**
- **Factions plugin**
- **PlaceholderAPI**

## Connections

- Server admin → KOTH commands: manages events (evidence: `src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java`)
- Plugin lifecycle → Plugin config: loads config (evidence: `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`)
- Plugin lifecycle → KOTH commands: registers (evidence: `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`)
- Plugin lifecycle → Points manager: initializes (evidence: `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`)
- Plugin lifecycle → Capture task: schedules (evidence: `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`)
- Plugin lifecycle → Placeholders: registers optionally (evidence: `src/main/java/fr/syrql/giantkoth/CustomGiantKoTH.java`)
- KOTH commands → KOTH provider: reads and changes (evidence: `src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java`)
- KOTH commands → KOTH event state: starts and configures (evidence: `src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java`)
- KOTH commands → Plugin config: reads messages (evidence: `src/main/java/fr/syrql/giantkoth/commands/GiantKoTHCommand.java`)
- Points manager → KOTH provider: loads and saves (evidence: `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`)
- Points manager → Death penalty: registers (evidence: `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`)
- Points manager → Plugin config: loads rewards (evidence: `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`)
- Points manager → Points ordering: sorts points (evidence: `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`)
- Points manager → Reward ranks: builds rewards (evidence: `src/main/java/fr/syrql/giantkoth/manager/KothPointsManager.java`)
- KOTH provider → KOTH event state: loads and stores (evidence: `src/main/java/fr/syrql/giantkoth/provider/KothPointsProvider.java`)
- KOTH provider → Event JSON files: reads and writes (evidence: `src/main/java/fr/syrql/giantkoth/provider/KothPointsProvider.java`)
- KOTH event state → Capture regions: creates regions (evidence: `src/main/java/fr/syrql/giantkoth/data/KothPointsData.java`)
- Capture regions → Region geometry: builds bounds (evidence: `src/main/java/fr/syrql/giantkoth/area/Area.java`)
- Capture task → KOTH provider: gets active events (evidence: `src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`)
- Capture task → KOTH event state: updates event state (evidence: `src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`)
- Capture task → Faction points: awards capture points (evidence: `src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`)
- Capture task → Factions plugin: checks faction players (evidence: `src/main/java/fr/syrql/giantkoth/task/KothPointsTask.java`)
- Death penalty → Faction points: reduces death points (evidence: `src/main/java/fr/syrql/giantkoth/listener/KothPointsListener.java`)
- Death penalty → Factions plugin: identifies faction (evidence: `src/main/java/fr/syrql/giantkoth/listener/KothPointsListener.java`)
- KOTH event state → Points manager: ranks winners (evidence: `src/main/java/fr/syrql/giantkoth/data/KothPointsData.java`)
- Placeholders → Points manager: reads event scores (evidence: `src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java`)
- Placeholders → Factions plugin: looks up player faction (evidence: `src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java`)
- Placeholders → Points ordering: sorts capper ranks (evidence: `src/main/java/fr/syrql/giantkoth/placeholder/GiantKoTHPlaceholder.java`)
- PlaceholderAPI → Placeholders: requests values (evidence: `README.md`)
