How ronanplugins/betterrtp works
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).