Build a standalone, modular ForbiddenClans Paper 1.21.x plugin using Java 21, Gradle Kotlin DSL, package com.forbidden.clans. Deliver production-conscious working feature code, plugin.yml, comprehensive config.yml, README, admin and ForbiddenQuest API documentation. No mandatory external plugins. UUID identities including Floodgate players. Implement persistent clans with unique validated case-insensitive names/tags, single owner, ADMIN/MEMBER ranks, settings, home/warps, level and centralized points with transaction history, invites, admin audit. Player commands /clan (GUI), gui, create, invite, accept, deny, leave, info, members, home, sethome, delhome, warp, setwarp, delwarp, promote, demote, kick, transfer, rename, description, rankup; practical tab completion. Admin commands /admin clan [gui|list|inspect|points add/remove|level set|ban|unban|delete|reload] with dedicated permissions. Inventory GUI for clan/no-clan, members/actions, settings, points/history, progression, home/warps, invitations, leaderboard and admin list/search/inspect/actions/audit; safe holder identification and block click/drag/movement exploits, confirmation for destructive/sensitive actions. GUI and commands use same server-side authorization and validation. Owner-only ownership/delete, admins cannot promote to equal or higher rank (this safety rule overrides the contradictory optional admin promotion request). Configurable rank permissions, progression costs/level limits/rewards, teleport delays/cancellation, PvP rewards/deductions with anti-farm cooldowns and caps, valid opposing clan PvP only, centralized atomic point mutation and upgrade confirmation. Expose documented validated public points API for future ForbiddenQuest and useful extension points. Ban handling and all mutation permissions should be consistent. YAML storage interface and implementation, safe main-thread snapshots and serialized async writes with atomic replacement, backups/retention, failure logging, corruption preservation/recovery guidance, startup validation, controlled shutdown flush; never access Bukkit API from storage tasks. Persist important changes promptly without main-thread disk writes after initialization. Detailed requirements include player-visible points earned/spent and history, configurable names/messages/GUI/balance, online/offline members, world-safe teleports, all requested feature access via commands and GUI. Keep implementation honest: identify any incomplete features explicitly rather than stubs. Do not create test files or scripts.

Kodari AI
KodariNov 14 at 7:29 am 7
ForbiddenClans
ForbiddenClans is a comprehensive Paper 1.21.x MMORPG clan plugin providing persistent player-created clans with unique validated names and tags, single ownership, ADMIN/MEMBER ranks, and centralized points economy with transaction history. It features full command suite (/clan, create, invite, accept, deny, leave, info, members, home, sethome, delhome, warp, setwarp, delwarp, promote, demote, kick, transfer, rename, description, rankup) and admin commands (/admin clan) with dedicated permissions. The plugin includes complete GUI system for clan management, settings, points/history, progression, home/warps, invitations, leaderboard, and admin inspection with safe holder identification and exploit prevention. Configurable rank permissions, progression costs/level limits/rewards, teleport delays/cancellation, PvP rewards/deductions with anti-farm cooldowns and caps, and centralized atomic point mutation. Exposes documented validated public points API for ForbiddenQuest integration. YAML storage with safe async writes, atomic replacement, backups/retention, failure logging, corruption preservation/recovery guidance, startup validation, and controlled shutdown flush. Supports UUID identities including Floodgate players, online/offline members, world-safe teleports, and configurable names/messages/GUI/balance.
  • Set up the Java 21 Gradle/Paper plugin, configuration, and persistent clan data model.

  • Implement clan services, validated commands, admin controls, points API, PvP handling, and safe delayed teleports.

  • Add holder-based GUI menus with confirmation/input flows and consistent authorization.

  • Document setup, administration, storage recovery, and the public ForbiddenQuest integration API.

Created the standalone Java 21 ForbiddenClans plugin for Paper 1.21.x, including commands, player/admin GUIs, clan progression and points, PvP rules, permissions, YAML persistence with backups, and the public ForbiddenClans API. Added the requested README, administrator guide, and API documentation.

Documented scope limits: PvP rewards cover direct player melee only, one invitation can be pending per player, and daily PvP counters reset on restart; storage is single-server YAML, not cross-server synchronized.

Address two critical discrepancies found after initial successful compilation. README says ADMIN can promote MEMBER to ADMIN; user explicitly forbids an ADMIN from promoting to a rank equal to or higher than their own. Enforce owner-only promotion to ADMIN centrally for all commands and GUI, update docs and hide unauthorized GUI actions. Also README says malformed clan YAML starts with empty in-memory state and periodic saves continue: prevent any chance of subsequently overwriting corrupt/invalid data with empty or partial state. Fail safely on malformed YAML or invalid/duplicate structural clan records, preserve originals and backups, disable mutations/saves or disable plugin until operator recovery; document exact recovery procedure. Review the actual storage and service code, implement both fixes, no tests.

Kodari AI
KodariNov 14 at 7:34 am 2

Plan:

  1. Enforce owner-only MEMBER→ADMIN promotion in the service and show only authorized member actions in the GUI.

  2. Make storage loading fail closed on malformed or structurally invalid clan data, preserving source files and blocking saves.

  3. Update recovery and rank-policy documentation.

  1. Promotion authorization: ClanService.promote now requires the clan owner, so ADMIN members cannot promote anyone, including a MEMBER. The GUI hides unauthorized member actions and rejects clicks on hidden action slots. Updated the README and admin guide.

  2. Fail-safe loading: Malformed YAML, unsupported schema versions, invalid records, and duplicate clan identities or memberships now stop plugin startup instead of loading partial state. The plugin does not register commands, the API, or scheduled saves after a failed load. It preserves the invalid file under a unique clans.corrupt-<timestamp>-<uuid>.yml name when possible and leaves existing backups untouched.

Added recovery steps to the README and admin guide, including how to preserve the data directory and restore or repair clans.yml before restarting.

xr0ot.exe

make this plugin

📎 1 file 12,029 chars
📄
pasted-code-1794648030748.txt
txt 616 lines
▶
# MASTER DEVELOPMENT PROMPT — RPGClans
## Custom Minecraft MMORPG Clan Management Plugin

You are a senior Minecraft plugin developer specializing in Java, Paper, Spigot, database architecture, inventory GUIs, and MMORPG progression systems.

Your task is to design and develop a complete, production-quality Minecraft clan management plugin called **RPGClans**.

This plugin is being developed for a custom medieval MMORPG Minecraft server.

Use the NewGen Team plugin as inspiration for feature organization, management capabilities, GUI design, and overall user experience.

Reference:
https://modrinth.com/plugin/newgen-team

IMPORTANT: Do not copy its source code, branding, or proprietary implementation. Create an original implementation with comparable functionality and additional MMORPG-specific systems.

---

# 1. CORE OBJECTIVE

Build a fully functional clan management system.

The plugin must support:

- Clan creation and deletion.
- Clan membership management.
- Clan ranks and permissions.
- Clan invitations.
- Clan chat.
- Clan bank.
- Clan storage.
- Clan home.
- Clan progression.
- Clan statistics.
- Clan leaderboards.
- Clan activity logs.
- Configurable inventory GUIs.
- Database persistence.

The plugin must be modular and expandable.

Future integrations should include:
- MMORPG Classes.
- MMORPG Economy.
- Player progression.
- Clan Wars.
- Clan Territories.
- Quests.
- Achievements.

Do not make these future systems mandatory dependencies.

# 2. TECHNOLOGY STACK

Use:

- Java 21.
- Paper API.
- Maven.
- SQLite as the initial database.
- MySQL support as an optional future/network configuration.
- Vault integration for economy.
- PlaceholderAPI integration.
- Adventure API for modern text formatting.

Use asynchronous database operations wherever appropriate.

Never perform blocking database queries on the Minecraft main server thread.

Support a configurable server version.

# 3. CLAN SYSTEM

Players should be able to create clans using:

/clan create  

Each clan should have:

- Unique clan ID.
- Clan name.
- Clan tag.
- Description.
- Owner UUID.
- Creation date.
- Member list.
- Clan level.
- Clan XP.
- Clan balance.
- Clan statistics.
- Clan home.
- Clan settings.

Enforce configurable limits for:

- Clan name length.
- Clan tag length.
- Maximum members.
- Name uniqueness.
- Tag uniqueness.
- Restricted characters.

A player must only belong to one clan at a time.

# 4. CLAN RANKS AND PERMISSIONS

For the initial release, use exactly three basic ranks:

OWNER
ADMIN
MEMBER

OWNER:
- Full clan management permissions.
- Change clan settings.
- Invite and remove members.
- Promote and demote members.
- Manage clan bank permissions.
- Manage clan storage permissions.
- Transfer ownership.
- Disband clan.

ADMIN:
- Invite players.
- Remove regular members.
- Manage permitted clan settings.
- Access permitted clan resources.

MEMBER:
- View clan information.
- Use clan chat.
- Access resources when permitted.
- Contribute to clan progression.

Implement a permission-based architecture so additional ranks can be added later without rewriting the system.

# 5. CLAN INVITATIONS

Implement:

/clan invite 
/clan accept 
/clan deny 
/clan leave

Requirements:

- Configurable invitation expiration.
- Prevent duplicate invitations.
- Prevent inviting players already in another clan.
- Prevent invitations when the clan is full.
- Notify both players.
- Store pending invitations safely.
- Validate invitations before acceptance.

# 6. CLAN GUI SYSTEM

Create a complete inventory-based GUI.

Main command:

/clan

The main GUI should contain:

1. Clan Information.
2. Members.
3. Invitations.
4. Clan Bank.
5. Clan Storage.
6. Clan Upgrades.
7. Clan Home.
8. Clan Settings.
9. Clan Statistics.
10. Leaderboard.

Each menu must be separately configurable.

Requirements:

- Configurable inventory titles.
- Configurable inventory sizes.
- Configurable item materials.
- Custom display names.
- Custom lore.
- Configurable menu positions.
- Navigation buttons.
- Back buttons.
- Confirmation menus for destructive actions.
- Permission-aware buttons.
- Pagination for member lists and leaderboards.

Never allow unauthorized players to execute actions through manipulated inventory clicks.

# 7. CLAN BANK

Implement a shared clan banking system.

Support:

- Depositing money.
- Withdrawing money.
- Viewing clan balance.
- Transaction history.
- Permission-based withdrawals.
- Configurable deposit and withdrawal limits.

Commands:

/clan bank
/clan deposit 
/clan withdraw 

Use Vault for economy integration.

All transactions must be validated and processed safely.

Prevent:

- Negative deposits.
- Negative withdrawals.
- Duplicate transactions.
- Concurrent balance corruption.
- Unauthorized withdrawals.

Maintain an auditable transaction history.

# 8. CLAN STORAGE

Implement a shared item storage system.

Features:

- Shared inventory.
- Configurable storage size.
- Upgradeable storage capacity.
- Permission-based access.
- Persistent item serialization.
- Safe inventory saving.
- Prevention of item duplication.

Handle server shutdowns and unexpected restarts safely.

# 9. CLAN HOME

Commands:

/clan home
/clan sethome

Features:

- Shared clan home.
- Configurable teleport cooldown.
- Configurable teleport delay.
- Optional movement cancellation.
- Permission-controlled home management.
- Safe location persistence.

Validate that saved locations are still available before teleporting.

# 10. CLAN LEVELING SYSTEM

Create an XP-based clan progression system.

Features:

- Clan XP.
- Clan levels.
- Configurable XP requirements.
- Upgrade rewards.
- Maximum level.
- Level-up notifications.

Potential upgrade rewards:

- Increased member capacity.
- Increased storage capacity.
- Additional clan home slots.
- Clan bank capacity improvements.
- Cosmetic clan rewards.

All XP requirements and rewards must be configurable.

Create levels.yml for progression configuration.

# 11. CLAN STATISTICS

Track:

- Total members.
- Total clan XP.
- Clan level.
- PvP kills.
- PvP deaths.
- Mob kills.
- Boss kills.
- Clan creation date.
- Total deposits.
- Total contributions.

Do not award duplicate statistics for repeated events or invalid combat situations.

# 12. CLAN LEADERBOARD

Create leaderboards for:

- Highest clan level.
- Highest clan XP.
- Most PvP kills.
- Most members.
- Highest clan balance.

Support pagination and configurable refresh intervals.

# 13. CLAN CHAT

Implement:

/clan chat
/clan chat 

Requirements:

- Private clan messaging.
- Configurable chat formatting.
- Clan tag display.
- Player name display.
- Toggle between public and clan chat.
- Prevent messages from reaching players outside the clan.

Use Adventure components for formatting.

# 14. CONFIGURATION STRUCTURE

Use an organized plugin directory:

plugins/RPGClans/

config.yml
database.yml
ranks.yml
levels.yml
economy.yml
settings.yml
theme.yml
hooks.yml

menus/
  main.yml
  members.yml
  bank.yml
  storage.yml
  upgrades.yml
  settings.yml
  statistics.yml
  leaderboard.yml

lang/
  en.yml

logs/

All important gameplay settings, messages, GUI layouts, economy costs, permissions, and progression requirements must be configurable.

Support configuration validation and useful error messages.

# 15. DATABASE ARCHITECTURE

Design a normalized and reliable database schema.

Store:

- Clans.
- Players and memberships.
- Clan ranks.
- Clan permissions.
- Invitations.
- Clan balances.
- Bank transactions.
- Clan XP.
- Clan upgrades.
- Clan homes.
- Clan storage.
- Clan statistics.
- Activity logs.

Use UUIDs as player identifiers.

Requirements:

- Database migrations.
- Connection management.
- Prepared statements.
- Proper indexing.
- Transaction safety.
- Persistent data across server restarts.
- Backup-friendly storage.
- Graceful database error handling.

Never rely exclusively on in-memory variables for persistent player or clan information.

# 16. COMMAND STRUCTURE

Player commands:

/clan
/clan create  
/clan info [clan]
/clan invite 
/clan accept 
/clan deny 
/clan leave
/clan kick 
/clan promote 
/clan demote 
/clan chat
/clan bank
/clan deposit 
/clan withdraw 
/clan home
/clan sethome
/clan members
/clan top

Administrative commands:

/clanadmin reload
/clanadmin disband 
/clanadmin delete 
/clanadmin setowner  
/clanadmin info 
/clanadmin setlevel  
/clanadmin setxp  
/clanadmin addbalance  
/clanadmin removebalance  

Implement tab completion and permission checks.

# 17. SECURITY AND DATA INTEGRITY

This is a critical requirement.

Prevent:

- Item duplication.
- Money duplication.
- Unauthorized inventory interactions.
- Unauthorized clan management.
- Invalid player UUIDs.
- Database corruption.
- Race conditions.
- Exploitative concurrent transactions.
- Invalid clan ownership transfers.
- Duplicate membership records.

Validate all inputs.

Never trust client-side inventory interactions.

Use atomic operations for sensitive financial and membership changes.

# 18. CODE ORGANIZATION

Use a modular package structure:

me.rpgclans
  RPGClans.java

  clan/
    Clan.java
    ClanManager.java
    ClanService.java

  member/
    ClanMember.java
    MemberManager.java

  rank/
    ClanRank.java
    PermissionManager.java

  invitation/
    Invitation.java
    InvitationManager.java

  gui/
    MenuManager.java
    MainMenu.java
    MemberMenu.java
    BankMenu.java
    StorageMenu.java
    UpgradeMenu.java

  economy/
    ClanBank.java
    TransactionManager.java

  storage/
    ClanStorage.java

  progression/
    ClanLevelManager.java
    ClanXPManager.java

  home/
    ClanHomeManager.java

  chat/
    ClanChatManager.java

  database/
    DatabaseManager.java
    SQLiteProvider.java
    MySQLProvider.java
    migrations/

  commands/
    ClanCommand.java
    ClanAdminCommand.java

  listeners/
    PlayerJoinListener.java
    InventoryListener.java
    PlayerQuitListener.java

  integrations/
    VaultHook.java
    PlaceholderAPIHook.java

  config/
    ConfigManager.java

  utils/
    MessageUtils.java
    UUIDUtils.java

# 19. DEVELOPMENT REQUIREMENTS

Build this plugin in clearly defined phases.

PHASE 1:
- Plugin initialization.
- Database.
- Clan creation.
- Clan membership.
- Owner, Admin, Member ranks.
- Invitations.
- Basic GUI.
- Persistent data.

PHASE 2:
- Clan chat.
- Clan bank.
- Clan storage.
- Clan home.

PHASE 3:
- Clan XP.
- Clan levels.
- Upgrades.
- Statistics.
- Leaderboards.

PHASE 4:
- Advanced configuration.
- PlaceholderAPI.
- Additional integrations.
- Testing.
- Performance optimization.

Do not create fake or nonfunctional features.

Every command, menu, and button must perform its intended action.

# 20. DELIVERABLES

Provide:

1. Complete Maven project.
2. Complete Java source code.
3. plugin.yml.
4. All configuration files.
5. Database implementation.
6. README.md.
7. Installation instructions.
8. Configuration documentation.
9. Permissions documentation.
10. Compiled RPGClans.jar.

The final plugin must compile successfully and be ready for installation on a compatible Paper server.

Do not omit important classes or replace implementation with pseudocode.

If the project is too large for one response, develop it phase by phase while maintaining consistent architecture and compiling compatibility.

Before writing the implementation, explain the architecture and database design, then begin Phase 1.

---

# FINAL DESIGN PHILOSOPHY

RPGClans should feel like a professional MMORPG guild management system.

Prioritize:

- Reliability.
- Performance.
- Persistent data.
- Security.
- Configurability.
- Attractive GUIs.
- Expandability.
- Compatibility with future MMORPG plugins.

The plugin should be designed as part of a larger interconnected Minecraft MMORPG ecosystem, not as an isolated basic clan plugin.
Kodari AI
KodariNov 14 at 9:44 am 10

Architecture: keep the existing com.forbidden.clans service boundary as the single authorization/mutation layer, with holder-identified GUIs delegating every action back to it. Extend the clan state for chat, bank ledger, storage, XP, and statistics; preserve the current YAML snapshot/backup model because it already provides fail-closed recovery and async atomic persistence, rather than replacing it with a second database path that risks existing clans. Vault and PlaceholderAPI remain optional hooks; neither becomes a required server plugin.

Added clan chat, serialized shared storage, an optional Vault-backed bank with transaction history, XP progression, persisted clan statistics, category leaderboards, and corresponding player/admin GUI and command actions. Bank and storage mutations use the central service for validation; sensitive admin GUI actions require confirmation. Added the XP extension API and configuration, admin, API, and recovery documentation.

This extends the existing ForbiddenClans Gradle/YAML project; it does not rename it to RPGClans or replace its fail-safe YAML storage with SQLite. MySQL, PlaceholderAPI, configurable GUI layouts, and storage-capacity upgrades are not implemented. Clan XP is earned by contributing points or through the API. No test files were added.

xr0ot.exe

done

Kodari AI
KodariNov 14 at 10:00 am 1

The RPGClans feature work is complete. The project remains named ForbiddenClans and uses YAML storage; SQLite, MySQL, PlaceholderAPI, and configurable GUI layouts were not implemented.

Kodari can make mistakes. Review important code before using.
Files
docs
src
build.gradle.kts
README.md
settings.gradle.kts
Code
22 3,733
src/main/java/com/forbidden/clans/ForbiddenClansPlugin.java
package com.forbidden.clans;

import com.forbidden.clans.command.AdminClanCommand;
import com.forbidden.clans.command.ClanCommand;
import com.forbidden.clans.gui.ClanGui;
import com.forbidden.clans.integration.ClanEconomy;
import com.forbidden.clans.integration.VaultEconomyProvider;
import com.forbidden.clans.listener.ClanListener;
import com.forbidden.clans.listener.ClanTeleportManager;
import com.forbidden.clans.model.Clan;
import com.forbidden.clans.service.ClanService;
import com.forbidden.clans.storage.ClanStorage;
import com.forbidden.clans.storage.YamlClanStorage;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;

public final class ForbiddenClansPlugin extends JavaPlugin {
    private final Map<UUID, Consumer<String>> chatPrompts = new ConcurrentHashMap<>();
    private ClanStorage storage;
    private ClanService clanService;
    private ForbiddenClansAPI api;
    private ClanGui clanGui;
    private ClanTeleportManager teleportManager;
    private ClanCommand clanCommand;
    private ClanEconomy economy;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        validateConfiguration();
        setupEconomy();
        storage = new YamlClanStorage(getDataFolder().toPath(), getConfig().getInt("settings.backup-retention", 10), getLogger(),
                getConfig().getInt("settings.name-min-length", 3), getConfig().getInt("settings.name-max-length", 16),
                getConfig().getInt("settings.tag-min-length", 2), getConfig().getInt("settings.tag-max-length", 5));
        try {
            Clan.State state = storage.load();
            clanService = new ClanService(this, storage, state);
        } catch (IllegalStateException exception) {
            getLogger().severe("ForbiddenClans is stopping because clan data failed validation. No clan commands, API, periodic saves, or shutdown snapshot will be registered. Recover clans.yml before restarting.");
            throw exception;
        }
        api = new ForbiddenClansAPI(this, clanService);
        clanGui = new ClanGui(this);
        teleportManager = new ClanTeleportManager(this);
        Bukkit.getServicesManager().register(ForbiddenClansAPI.class, api, this, ServicePriority.Normal);
        getServer().getPluginManager().registerEvents(new ClanListener(this), this);
        getServer().getPluginManager().registerEvents(teleportManager, this);
        getServer().getPluginManager().registerEvents(clanGui, this);
        clanCommand = new ClanCommand(this);
        getCommand("clan").setExecutor(clanCommand);
        getCommand("clan").setTabCompleter(clanCommand);
        AdminClanCommand admin = new AdminClanCommand(this);
        getCommand("admin").setExecutor(admin);
        getCommand("admin").setTabCompleter(admin);
        long autosave = Math.max(60, getConfig().getLong("settings.autosave-seconds", 300));
        Bukkit.getScheduler().runTaskTimer(this, clanService::save, autosave * 20L, autosave * 20L);
        getLogger().info("ForbiddenClans enabled with " + clanService.getClans().size() + " clan(s).");
    }

    @Override
    public void onDisable() {
        chatPrompts.clear();
        if (clanService != null) clanService.save();
        if (storage != null) storage.flush();
        if (api != null) Bukkit.getServicesManager().unregister(ForbiddenClansAPI.class, api);
    }

    public ClanService getClanService() { return clanService; }
    public ForbiddenClansAPI getForbiddenClansAPI() { return api; }
    public ClanGui getClanGui() { return clanGui; }
    public ClanTeleportManager getTeleportManager() { return teleportManager; }
    public ClanCommand getClanCommand() { return clanCommand; }
    public ClanEconomy getEconomy() { return economy; }

    private void setupEconomy() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            getLogger().info("Vault not found; clan-bank commands will remain unavailable.");
            return;
        }
        economy = VaultEconomyProvider.hook(this);
        if (economy == null) getLogger().warning("Vault is installed, but no economy provider is registered; clan-bank commands will remain unavailable.");
        else getLogger().info("Hooked clan bank into economy provider " + economy.name() + ".");
    }

    public void reloadSettings() {
        reloadConfig();
        validateConfiguration();
    }

    public void send(Player player, String key) { send(player, key, Map.of()); }

    public void send(Player player, String key, Map<String, String> replacements) {
        String message = getConfig().getString("messages." + key, key);
        for (Map.Entry<String, String> entry : replacements.entrySet()) message = message.replace("{" + entry.getKey() + "}", entry.getValue());
        player.sendMessage(color(getConfig().getString("messages.prefix", "") + message));
    }

    public void sendRaw(Player player, String message) {
        player.sendMessage(color(getConfig().getString("messages.prefix", "") + message));
    }

    public String color(String text) { return ChatColor.translateAlternateColorCodes('&', text); }

    public void requestChat(Player player, String prompt, Consumer<String> callback) {
        chatPrompts.put(player.getUniqueId(), callback);
        player.closeInventory();
        sendRaw(player, prompt + " &7(Type &ccancel&7 to abort.)");
    }

    public boolean handlePrompt(Player player, String message) {
        Consumer<String> callback = chatPrompts.remove(player.getUniqueId());
        if (callback == null) return false;
        if (message.equalsIgnoreCase("cancel")) {
            sendRaw(player, "&eInput cancelled.");
            return true;
        }
        callback.accept(message);
        return true;
    }

    public boolean hasChatPrompt(UUID playerId) { return chatPrompts.containsKey(playerId); }

    public String plainMessage(net.kyori.adventure.text.Component component) {
        return PlainTextComponentSerializer.plainText().serialize(component);
    }

    private void validateConfiguration() {
        int nameMin = getConfig().getInt("settings.name-min-length", 3);
        int nameMax = getConfig().getInt("settings.name-max-length", 16);
        int tagMin = getConfig().getInt("settings.tag-min-length", 2);
        int tagMax = getConfig().getInt("settings.tag-max-length", 5);
        if (nameMin < 1 || nameMax < nameMin || tagMin < 1 || tagMax < tagMin) {
            getLogger().warning("Invalid clan name/tag length bounds; resetting these settings to safe defaults.");
            getConfig().set("settings.name-min-length", 3);
            getConfig().set("settings.name-max-length", 16);
            getConfig().set("settings.tag-min-length", 2);
            getConfig().set("settings.tag-max-length", 5);
            saveConfig();
        }
        if (getConfig().getInt("progression.max-level", 10) < 1) {
            getLogger().warning("progression.max-level must be at least 1; using 10.");
            getConfig().set("progression.max-level", 10);
            saveConfig();
        }
        if (getConfig().getInt("settings.max-members", 30) < 1) {
            getLogger().warning("settings.max-members must be at least 1; using 30.");
            getConfig().set("settings.max-members", 30);
            saveConfig();
        }
        if (getConfig().getLong("points.max-balance", Long.MAX_VALUE) < 0) {
            getLogger().warning("points.max-balance cannot be negative; using the maximum long balance.");
            getConfig().set("points.max-balance", Long.MAX_VALUE);
            saveConfig();
        }
        int storageSize = getConfig().getInt("storage.size", 54);
        if (storageSize < 9 || storageSize > 54 || storageSize % 9 != 0) {
            getLogger().warning("storage.size must be a multiple of 9 from 9 to 54; using 54.");
            getConfig().set("storage.size", 54);
            saveConfig();
        }
        double bankLimit = getConfig().getDouble("bank.max-balance", 1_000_000_000_000.0);
        double transactionLimit = getConfig().getDouble("bank.max-transaction", 1_000_000.0);
        if (!Double.isFinite(bankLimit) || bankLimit <= 0) {
            getLogger().warning("bank.max-balance must be finite and positive; using 1000000000000.");
            getConfig().set("bank.max-balance", 1_000_000_000_000.0);
            saveConfig();
        }
        if (!Double.isFinite(transactionLimit) || transactionLimit <= 0) {
            getLogger().warning("bank.max-transaction must be finite and positive; using 1000000.");
            getConfig().set("bank.max-transaction", 1_000_000.0);
            saveConfig();
        }
    }
}