# thomasmny/buildsystem architecture

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

- Interactive diagram: https://gitdiagram.com/thomasmny/buildsystem
- Repository: https://github.com/thomasmny/buildsystem

## Overview

##### Main Components
- Plugin Entry Point/Core Layer:
– This is represented by the buildsystem-core package. It includes the BuildSystem class, command handlers, event listeners, configuration managers, and navigators. It’s the “brain” of the plugin.
- Abstraction/Adapter Layer:
– Under buildsystem-abstraction, you have separate directories for each Minecraft version adapter (e.g., adapter-1_12, adapter-1_13, etc.) plus a common folder. This layer encapsulates version-specific behavior, allowing the core to interact with different Minecraft API versions.
- Build Configuration & Plugin Setup:
– The buildSrc directory and Gradle scripts (settings.gradle.kts, build.gradle.kts files) handle build configurations and dependency management.
- External Integrations:
– There are expansion packages for external APIs (e.g., LuckPerms and PlaceholderAPI) that integrate with services for permissions and dynamic placeholders.
- Resource and Configuration Files:
– The resources in buildsystem-core/src/main/resources (e.g., config.yml and plugin.yml) provide runtime configuration for the plugin.

##### Relationships and Interactions
- The Plugin Entry Point (core) initializes and delegates functions to sub-components:
– It registers commands (via classes in buildsystem-core/command) and listeners (under buildsystem-core/listener) with the server’s event system.
– It then interacts with the abstraction layer to adapt behavior based on the running Minecraft version.
- The Abstraction Layer provides version-specific implementations for core functionality (e.g., handling custom block and game rule logic within buildsystem-abstraction/adapter-<version>).
- There is a clear separation between user interface elements:
– The navigators (the interactive GUI elements found in buildsystem-core/navigator) and modification inventories are isolated from lower-level logic but interact via event listeners.
- External APIs like LuckPerms and PlaceholderAPI are integrated as expansion modules. They plug into the core to extend functionality (e.g., permissions calculations or dynamic placeholders).

##### Architectural Patterns
- Modularity:
– The project uses a modular approach with a distinct core and dedicated abstraction modules.
- Adapter/Abstraction Pattern:
– The multiple adapter directories indicate the use of the adapter pattern, isolating version-specific logic.
- Event-Driven Programming:
– The use of listeners (in buildsystem-core/listener) shows a reliance on an event-driven architecture to handle in-game events.
- Command and Navigator Patterns:
– Commands and subcommands in buildsystem-core/command and navigators provide structured, class-based command handling and user interaction.

##### Relevant Technologies and Frameworks
- Java-based development (with Kotlin files for build configuration).
- Gradle for building and dependency management.
- The Bukkit/Spigot API for interfacing with Minecraft servers.
- Integration with third-party plugins such as LuckPerms and PlaceholderAPI.

- Use clear labels for each component:
– Label blocks “Plugin Core,” “Adapter Layer (Version 1_12, 1_13, etc.),” “Command Manager,” “Event Dispatcher,” “Configuration Manager,” “Navigator/UI,” and “External Integrations.”
- Notes or annotations:
– Mark build system interactions (e.g., “Gradle Build Scripts” in a separate build configuration block).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Layer
    subgraph "Core Layer"
        buildSys["Plugin Core\n(BuildSystem)"]:::core
        command["Command Manager\n(Commands)"]:::core
        listener["Event Dispatcher\n(Listeners)"]:::core
        config["Configuration Manager\n(Resources & Config)"]:::config
        navigator["Navigator/UI"]:::core
    end

    %% Abstraction Layer
    subgraph "Abstraction Layer"
        adapterCommon["Common Adapter"]:::adapter
        adapter112["Adapter 1_12"]:::adapter
        adapter113["Adapter 1_13"]:::adapter
        adapter114["Adapter 1_14"]:::adapter
        adapter117["Adapter 1_17"]:::adapter
        adapter120["Adapter 1_20"]:::adapter
    end

    %% External Integrations
    subgraph "Expansions"
        luckperms["LuckPerms Integration"]:::external
        placeholder["PlaceholderAPI Integration"]:::external
    end

    %% Build & Configuration
    subgraph "Build & Configuration"
        buildConfig["Build & Plugin Setup\n(Gradle & BuildSrc)"]:::build
    end

    %% Relationships within Core Layer
    buildSys -->|"RegistersCommands"| command
    buildSys -->|"RegistersListeners"| listener
    buildSys -->|"LoadsConfig"| config
    buildSys -->|"InitializesUI"| navigator

    %% Core to Abstraction
    buildSys -->|"DelegatesVersionFunctions"| adapterCommon

    %% Core to Expansions
    buildSys -->|"Integrates"| luckperms
    buildSys -->|"Integrates"| placeholder

    %% Build System dependency
    buildConfig -->|"BuildsPlugin"| buildSys

    %% Styling for vertical layout clarity: additional vertical connections in Abstraction Layer
    adapterCommon --> adapter112
    adapter112 --> adapter113
    adapter113 --> adapter114
    adapter114 --> adapter117
    adapter117 --> adapter120

    %% Click Events
    click buildSys "https://github.com/thomasmny/buildsystem/blob/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/BuildSystem.java"
    click command "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/command"
    click listener "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/listener"
    click config "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/resources"
    click navigator "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/navigator"
    click adapterCommon "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction"
    click adapter112 "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction/adapter-1_12"
    click adapter113 "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction/adapter-1_13"
    click adapter114 "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction/adapter-1_14"
    click adapter117 "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction/adapter-1_17"
    click adapter120 "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-abstraction/adapter-1_20"
    click buildConfig "https://github.com/thomasmny/buildsystem/tree/master/buildSrc"
    click luckperms "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/expansion/luckperms"
    click placeholder "https://github.com/thomasmny/buildsystem/tree/master/buildsystem-core/src/main/java/de/eintosti/buildsystem/expansion/placeholderapi"

    %% Styles
    classDef core fill:#B3CDE0,stroke:#000,stroke-width:1px;
    classDef adapter fill:#C1E1C1,stroke:#000,stroke-width:1px;
    classDef config fill:#FEEFB3,stroke:#000,stroke-width:1px;
    classDef build fill:#FFDAB9,stroke:#000,stroke-width:1px;
    classDef external fill:#D8BFD8,stroke:#000,stroke-width:1px;
```
