How auxilor/libreforge works
Main Components
• Loader Module: Represented by the “loader” directory. This is where the entry point of the plugin is defined (LibreforgePlugin and LibreforgeLoader classes). It is responsible for initializing the plugin, loading configurations (from YAML files such as config.yml, chains.yml, etc.), and setting up the environment.
• Core Module: This is the heart of libreforge and is divided among submodules (common, legacy, modern). Under “core/common” you find the primary business logic, including:
– Commands: Responsible for interacting with in-game commands (see the commands package with CommandLibreforge, CommandPointsGive, etc.).
– Conditions: A rich set of classes that define when an effect may fire (organized under conditions, with many implementations).
– Effects: Modules that define what actions to execute (e.g., EffectAddDamage, EffectGiveXp, etc., along with dedicated sub-packages for animations, bossbars, particles, and more).
– Triggers: Mechanisms to detect game events and then dispatch configured actions.
– Filters, Counters, Mutators, and Placeholders: Each acts as a building block for the engine to process modifications and data flow, influencing when and how effects are applied.
– Configs: YAML configuration parsing and mapping (in configs packages). This is where the “scripting” aspect is tied into the engine.
• Gradle Plugin: Found under “gradle-plugin”. This is used to facilitate the build and, possibly, the distribution of the project.
• Library/JAR Dependencies: The “lib” directory shows external jars (such as AxEnvoy, FancyNpcs, TAB, etc.) that libreforge leverages for integrations.
Relationships and Data Flows
• Within the Core, split the engine into “Effects”, “Conditions”, “Triggers”, “Commands”, and “Filters”. Show that commands can trigger effects (often via conditions being checked first) and that triggers are responsible for detecting in-game events that route to conditions and then fire effects.
• That the system supports multiple modes (legacy and modern) in the Core, so include distinct sections for “legacy proxy” and “modern proxy” implementations, showing that there is a translation layer in between (as seen in subpackages under core/legacy/proxy and core/modern/proxy).
Architectural Patterns and Design Principles
• Modular Architecture: Emphasize the separation into loader, core (with further modular subdivisions), gradle plugin, and integration libraries. Each module should be a clearly demarcated unit of responsibility.
• Plugin/Extension Pattern: The integrations and the plugin loader indicate a pluggable design. You might represent this using “adapter” symbols for integrations.
• Configuration-Driven Behavior: Many components react to YAML configuration data. Mark these configuration dependencies clearly and show how resource files (found in core/common/src/main/resources) are used.