# to1maszproblem/mc-landskey architecture

> Architecture diagram of the GitHub repository to1maszproblem/mc-landskey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/to1maszproblem/mc-landskey
- Repository: https://github.com/to1maszproblem/mc-landskey

## Overview

##### Project type and purpose
- This is a Bukkit/Spigot plugin for Minecraft 1.16+ that manages “keys” for accessing different “lands” (krainy).
- The README confirms it: “Plugin na klucze do krain 1.16+.”

##### File structure
- Top‐level:
- pom.xml / dependency‐reduced-pom.xml – Maven build and dependency management
- src/main/java/… – Java source
- src/main/resources/plugin.yml – Spigot plugin descriptor
- Under src/main/java/pl/to1maszproblem:
- Main.java – plugin entry point (extends JavaPlugin)
- commands/ – command handlers (KrainaCommand)
- listener/ – event listeners (PlayerInteractListener)
- configuration/ – config‐file wrappers (Configuration, MessageConfiguration)
- module/ – core domain logic (LandsKey)
- notice/ – notification abstraction and serialization (Notice, NoticeType, NoticeSerializer)
- util/ – helper utilities (TextUtil)

##### README
- Minimal, but confirms plugin use case: giving/managing keys for lands in Minecraft 1.16+.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems
    Server["Minecraft Server (Spigot/Bukkit)"]:::external

    %% Plugin Module
    subgraph "MC-LandsKey Plugin" 
        direction TB

        subgraph "Entry Points"
            direction TB
            Main["Main"]:::entry
            KrainaCommand["KrainaCommand"]:::entry
            PlayerInteractListener["PlayerInteractListener"]:::entry
        end

        subgraph "Configuration Subsystem"
            direction TB
            Configuration["Configuration"]:::config
            MessageConfiguration["MessageConfiguration"]:::config
            PluginYML[(plugin.yml)]:::config
        end

        subgraph "Core Logic Module"
            direction TB
            LandsKey["LandsKey"]:::core
        end

        subgraph "Notice Subsystem"
            direction TB
            Notice["Notice"]:::notice
            NoticeType["NoticeType"]:::notice
            NoticeSerializer["NoticeSerializer"]:::notice
        end

        subgraph "Utility Helpers"
            direction TB
            TextUtil["TextUtil"]:::util
        end
    end

    %% Registration at startup
    Server -->|"loads plugin.jar & reads plugin.yml"| Main
    Main -->|"registers command"| KrainaCommand
    Main -->|"registers listener"| PlayerInteractListener

    %% Command Flow
    Server -->|"player issues /kraina"| KrainaCommand
    KrainaCommand -->|"reads config"| Configuration
    KrainaCommand -->|"invokes business logic"| LandsKey
    LandsKey -->|"consults config"| Configuration
    LandsKey -->|"formats text"| TextUtil
    LandsKey -->|"triggers notice"| NoticeSerializer
    NoticeSerializer -->|"uses Notice & NoticeType"| Notice
    NoticeSerializer -->|"sends message via API"| Server

    %% Event Flow
    Server -->|"player interacts world"| PlayerInteractListener
    PlayerInteractListener -->|"invokes business logic"| LandsKey

    %% Config loading
    Main -->|"loads static config"| PluginYML
    Main -->|"wraps into objects"| Configuration
    Main -->|"wraps into objects"| MessageConfiguration

    %% Utility usage
    KrainaCommand -->|"formats text"| TextUtil
    PlayerInteractListener -->|"formats text"| TextUtil

    %% Click Events
    click Main "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/Main.java"
    click KrainaCommand "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/commands/KrainaCommand.java"
    click PlayerInteractListener "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/listener/PlayerInteractListener.java"
    click Configuration "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/configuration/Configuration.java"
    click MessageConfiguration "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/configuration/MessageConfiguration.java"
    click PluginYML "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/resources/plugin.yml"
    click LandsKey "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/module/LandsKey.java"
    click Notice "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/notice/Notice.java"
    click NoticeType "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/notice/NoticeType.java"
    click NoticeSerializer "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/notice/NoticeSerializer.java"
    click TextUtil "https://github.com/to1maszproblem/mc-landskey/blob/master/src/main/java/pl/to1maszproblem/util/TextUtil.java"

    %% Styles
    classDef external fill:#f0f0f0,stroke:#333,stroke-width:1px;
    classDef entry fill:#cce5ff,stroke:#004085,stroke-width:1px;
    classDef config fill:#fff3cd,stroke:#856404,stroke-width:1px;
    classDef core fill:#d4edda,stroke:#155724,stroke-width:1px;
    classDef notice fill:#ffe5b4,stroke:#ff8c00,stroke-width:1px;
    classDef util fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
```
