# ronanplugins/betterrtp architecture

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

- Interactive diagram: https://gitdiagram.com/ronanplugins/betterrtp
- Repository: https://github.com/ronanplugins/betterrtp

## Overview

##### Project Type and Purpose
- This is a multi-module Java project that builds a Minecraft server plugin (for Spigot/Paper/Folia) which provides advanced random teleportation (“RTP”) features.
- The repository contains the core plugin logic (in the “src” folder), additional functionality via addons (“BetterRTPAddons”), a separate module for handling per‐world RTP databases (“RTPEachWorld”), and even a NodeServer module (a small Node.js component that appears to offer a web or administrative interface).

##### File Structure
- The “src” folder (under the top-level directory) contains the core BetterRTP code. It is organized into sub-packages for commands, event listeners, core logic (RTP, players, and effects), utility classes, and database interactions.
- The “BetterRTPAddons” directory mirrors the core structure but focuses on optional or extended functions (e.g., extra effects, flashback, magic stick, portals, parties, rtp menus). It is structured to allow easy addition of new add-on modules.
- The “RTPEachWorld” module appears dedicated to managing per-world player data and database handling, signifying specialized treatment of RTP across different worlds.
- There’s also a “NodeServer” module containing an index.js and package.json, hinting at a lightweight web server or node-based dashboard that may provide additional functionality like metrics or remote control.

##### Suggested Components & Their Relationships
a. Core Plugin (BetterRTP)
- This includes the main entry point (BetterRTP.java), command handling (under player/commands), event listeners (player/events), and the RTP logic (player/rtp and its effects and packets).
- Dependencies: Integrated with external libraries (PaperLib, FoliaLib, ParticleLib) and relies on internal helpers and references (permissions, custom events, logger, etc.).

b. Addons Manager (BetterRTPAddons)
- Acts as an extension layer that dynamically loads and manages separate addon modules.
- Each addon (extra effects, flashback, magic stick, portals, parties, rtpmenu) is organized in its own package.
- Interacts with the core plugin via a registration/command pattern.

c. RTPEachWorld Module
- Handles world-specific RTP configuration and custom database management for players.
- Likely interfaces with the core plugin to deliver specialized behavior per world.

d. NodeServer
- A Node.js-based component that might serve a web interface/dashboard.
- Although small, it interacts externally (or for administration or metrics) with the core system.

e. Database / Persistence Layer
- Represented in multiple packages (both in core and addons) and includes classes for database actions, error handling, and player-data management.
- Designed for tracking teleport requests, cooldowns, and world/player data.

f. External and Platform Integrations
- Libraries: ParticleLib (for visual effects), PaperLib/FoliaLib (for asynchronous tasks and platform support).
- Dependencies: Integration with region plugins and economy systems (referenced in the “depends” packages).

## Diagram (Mermaid)

```mermaid
graph TD
    %% External Input
    MS["Minecraft Server / Players"]:::external

    %% Core System
    CP["Core Plugin (BetterRTP)"]:::core
    EW["RTPEachWorld Module"]:::core
    NS["NodeServer"]:::module

    %% Addons Layer
    AM["Addons Manager"]:::addon

    %% Database / Persistence Layer
    DB_Core["Database (Core)"]:::db
    DB_Addons["Database (Addons)"]:::db

    %% External Libraries/Integrations
    PL["ParticleLib"]:::external
    PF["PaperLib/FoliaLib"]:::external
    EX["Other Plugins (Regions/Economy)"]:::external

    %% Data & Control Flow
    MS -->|"commands/events"| CP
    CP -->|"registers"| AM
    AM -->|"communicates"| CP
    CP -->|"world-specific calls"| EW
    CP -->|"reads/writes"| DB_Core
    AM -->|"database access"| DB_Addons
    CP -->|"admin/metrics"| NS
    NS -->|"feedback"| CP
    CP -->|"visual effects"| PL
    CP -->|"async support"| PF
    CP -->|"integrates"| EX

    %% Click Events for Component Mapping
    click CP "https://github.com/ronanplugins/betterrtp/tree/master/src/main/java/me/SuperRonanCraft/BetterRTP"
    click AM "https://github.com/ronanplugins/betterrtp/tree/master/BetterRTPAddons/src/main/java/me/SuperRonanCraft/BetterRTPAddons"
    click EW "https://github.com/ronanplugins/betterrtp/tree/master/RTPEachWorld/src/me/superronancraft/rtpeachworld"
    click NS "https://github.com/ronanplugins/betterrtp/tree/master/NodeServer"
    click DB_Core "https://github.com/ronanplugins/betterrtp/tree/master/src/main/java/me/SuperRonanCraft/BetterRTP/references/database"
    click DB_Addons "https://github.com/ronanplugins/betterrtp/tree/master/BetterRTPAddons/src/main/java/me/SuperRonanCraft/BetterRTPAddons/database"

    %% Styles
    classDef core fill:#ffcccb,stroke:#b22222,stroke-width:2px;
    classDef addon fill:#e0ffff,stroke:#008b8b,stroke-width:2px;
    classDef module fill:#fafad2,stroke:#daa520,stroke-width:2px;
    classDef db fill:#ffe4b5,stroke:#cd853f,stroke-width:2px;
    classDef external fill:#d3ffce,stroke:#2e8b57,stroke-width:2px;
```
