
Mogrul Lib
Mogrul Lib is a compact library designed to simplify the integration of mods from a single developer. The main purpose of this library is centralized management of the SQL driver, avoiding its repeated loading across different mods.
The library automatically creates a .db database file in the config/Mogrul directory where player data is stored. For convenient work with this information, API classes PlayerData and Player are provided, which simplify retrieving and updating values related to players.
Library API
PlayerData
The PlayerData class contains the following fields:
- UUID uuid: player's unique identifier
- String username: player's username
- Instant firstJoined: date and time of player's first login
- Instant lastJoined: date and time of player's last login
- String discordID: Discord ID linked to the player
- int playtimeMinutes: total play time in minutes
- int currency: amount of in-game currency
- int bounty: player's bounty value
Player management methods
To get player information, the Player.get() method is used, which accepts various parameters: ServerPlayer, username (String), Discord ID (String), or UUID.