# shotxd012/shot-pl architecture

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

- Interactive diagram: https://gitdiagram.com/shotxd012/shot-pl
- Repository: https://github.com/shotxd012/shot-pl

## Overview

##### Project type and purpose
- This is a Java-based Minecraft server plugin (Spigot/Paper) called Shot-PL, providing basic server lifecycle hooks, welcome messages, stats commands, leaderboard functionality, and a simple GUI.
- It integrates directly into the Minecraft server plugin loader and depends on the Spigot API 1.20.4.

##### File structure
- Top-level build files: pom.xml, dependency-reduced-pom.xml (Maven build and shading), .gitignore, README.md.
- src/main/java/com/example:
- ShotPL.java – main plugin class (implements onEnable/onDisable)
- api/ServerAPI.java – wrapper around external or server-level API calls
- commands/LeaderboardCommand.java, StatsCommand.java – command handlers
- database/DatabaseManager.java – database connection and query manager
- gui/StatsGUI.java – in-game GUI component
- src/main/resources:
- plugin.yml – plugin metadata and command registrations
- config.yml – plugin configuration

##### README for additional insights
- Requires Java 17+, Maven, Spigot/Paper 1.20.x.
- Plugin lifecycle and installation steps are documented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    Player["Player"]:::external
    MinecraftServer["Minecraft Server (Spigot)"]:::server
    PluginLoader["Plugin Loader"]:::server

    %% Plugin Subgraph
    subgraph "Shot-PL Plugin JAR"
        ShotPL["Shot-PL Main (ShotPL)"]:::plugin
        ServerAPI["ServerAPI"]:::plugin
        DatabaseManager["DatabaseManager"]:::plugin
        LeaderboardCommand["LeaderboardCommand"]:::plugin
        StatsCommand["StatsCommand"]:::plugin
        StatsGUI["StatsGUI"]:::plugin
        pluginYml["plugin.yml"]:::plugin
        configYml["config.yml"]:::plugin
        pom["pom.xml"]:::external
    end

    %% External Systems
    ExternalDB["External Database"]:::external
    ExternalService["External Service"]:::external

    %% Connections: Player to Server
    Player -->|"event: join/command"| MinecraftServer

    %% Server to Plugin Loader to Plugin Main
    MinecraftServer --> PluginLoader
    PluginLoader --> ShotPL

    %% Loader reads metadata and config
    PluginLoader -->|"reads"| pluginYml
    PluginLoader -->|"reads"| configYml
    PluginLoader -->|"build info"| pom

    %% Main plugin initialization and dependencies
    ShotPL -->|"uses"| ServerAPI
    ShotPL -->|"initializes"| DatabaseManager
    ShotPL -->|"registers"| LeaderboardCommand
    ShotPL -->|"registers"| StatsCommand
    ShotPL -->|"registers GUI"| StatsGUI

    %% Command and GUI interactions
    LeaderboardCommand -->|"queries"| DatabaseManager
    StatsCommand -->|"queries"| DatabaseManager
    LeaderboardCommand -->|"displays"| StatsGUI
    StatsCommand -->|"displays"| StatsGUI

    %% Database and external services
    DatabaseManager -->|"connects to"| ExternalDB
    ServerAPI -->|"calls"| ExternalService

    %% Styles
    classDef server fill:#dddddd,stroke:#666,stroke-width:1px;
    classDef plugin fill:#a8d0e6,stroke:#333,stroke-width:1px;
    classDef external fill:#b8e2a0,stroke:#333,stroke-width:1px;

    %% Click Events
    click ShotPL "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/ShotPL.java"
    click ServerAPI "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/api/ServerAPI.java"
    click LeaderboardCommand "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/commands/LeaderboardCommand.java"
    click StatsCommand "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/commands/StatsCommand.java"
    click DatabaseManager "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/database/DatabaseManager.java"
    click StatsGUI "https://github.com/shotxd012/shot-pl/blob/main/src/main/java/com/example/gui/StatsGUI.java"
    click pluginYml "https://github.com/shotxd012/shot-pl/blob/main/src/main/resources/plugin.yml"
    click configYml "https://github.com/shotxd012/shot-pl/blob/main/src/main/resources/config.yml"
    click pom "https://github.com/shotxd012/shot-pl/blob/main/pom.xml"
```
