package top.r3944realms.lib39.base.datagen.value;

import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Unmodifiable;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.content.register.Lib39Blocks;
import top.r3944realms.lib39.content.register.Lib39Items;
import top.r3944realms.lib39.content.register.Lib39SoundEvents;
import top.r3944realms.lib39.datagen.value.ILangKeyValueCollection;
import top.r3944realms.lib39.datagen.value.LangKeyValue;
import top.r3944realms.lib39.datagen.value.ModPartEnum;
import top.r3944realms.lib39.example.core.register.ExLib39Items;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * The enum Lib 39 lang key.
 */
public enum Lib39LangKey implements ILangKeyValueCollection {
    /**
     * Instance lib 39 lang key.
     */
    INSTANCE;
    Lib39LangKey() {
        initLangKeyValues();
    }

    /**
     * The type Message.
     */
    public static final class Message {
        private static final Set<LangKeyValue> items = new HashSet<>();
        /**
         * The constant HELP_HEADER.
         */
        public static final LangKeyValue HELP_HEADER = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.header", ModPartEnum.MESSAGE,
                        "===== %s =====",
                        "===== %s 命令帮助 =====",
                        "===== %s 命令幫助 =====",
                        "〇〇 %s 〇〇",  // 文言文：用〇〇表示分隔線
                        true
                )
        );

        /**
         * The constant HELP_CLICK_EXPAND.
         */
        public static final LangKeyValue HELP_CLICK_EXPAND = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.click_expand", ModPartEnum.MESSAGE,
                        "Click to expand",
                        "點擊展開",
                        "點擊展開",
                        "點展",
                        true
                )
        );

        /**
         * The constant HELP_PAGE_INFO.
         */
        public static final LangKeyValue HELP_PAGE_INFO = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.page_info", ModPartEnum.MESSAGE,
                        "Page %d of %d",
                        "第 %d 页，共 %d 页",
                        "第 %d 頁，共 %d 頁",
                        "第 %d 卷，凡 %d 卷",  // 文言文：用「卷」表示頁
                        true
                )
        );

        /**
         * The constant HELP_NO_ENTRIES.
         */
        public static final LangKeyValue HELP_NO_ENTRIES = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.no_entries", ModPartEnum.MESSAGE,
                        "No help entries available",
                        "暂无帮助条目",
                        "暫無幫助條目",
                        "尚無助之目錄",  // 文言文：尚無幫助的目錄
                        true
                )
        );

        /**
         * The constant HELP_TOGGLE_FAILED.
         */
        public static final LangKeyValue HELP_TOGGLE_FAILED = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.toggle_failed", ModPartEnum.MESSAGE,
                        "Toggle Failed: No Hash Cached",
                        "切换失败: 无缓存Hash",
                        "切換失敗: 無緩存Hash",
                        "變更未果: 無貯存之哈希",  // 文言文：變更沒有成功，沒有貯存的哈希
                        true
                )
        );

        /**
         * The constant HELP_COMMAND_NOT_FOUND.
         */
        public static final LangKeyValue HELP_COMMAND_NOT_FOUND = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.command_not_found", ModPartEnum.MESSAGE,
                        "Command not found: %s",
                        "命令不存在: %s",
                        "指令不存在: %s",
                        "令未見之: %s",  // 文言文：命令沒有見到
                        true
                )
        );
        /**
         * The constant DOLL_SOUND.
         */
        public static final LangKeyValue DOLL_SOUND = addAndRet(
                LangKeyValue.ofKey(
                        Lib39SoundEvents.getSubTitleTranslateKey("duck_toy"), ModPartEnum.SOUND,
                        "Duck Doll Sound",
                        "玩偶声音",
                        "玩偶聲音",
                        "偶音",
                        true
                )
        );


        /**
         * The constant HELP_SUBCOMMANDS_TITLE.
         */
        public static final LangKeyValue HELP_SUBCOMMANDS_TITLE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.subcommands_title", ModPartEnum.MESSAGE,
                        "Subcommands:",
                        "子命令:",
                        "子指令:",
                        "子令:",  // 文言文：子命令
                        true
                )
        );

        /**
         * The constant HELP_NODE_EXPAND.
         */
        public static final LangKeyValue HELP_NODE_EXPAND = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.node.expand", ModPartEnum.MESSAGE,
                        "%d subcommands collapsed",
                        "%d 个子命令已折叠",
                        "%d 個子指令已折疊",
                        "%d 子令已收",  // 文言文：子命令已經收起
                        true
                )
        );

        /**
         * The constant HELP_NODE_TOGGLE_EXPAND.
         */
        public static final LangKeyValue HELP_NODE_TOGGLE_EXPAND = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.node.toggle.expand", ModPartEnum.MESSAGE,
                        "Expand",
                        "展开",
                        "展開",
                        "展",  // 文言文：展開
                        true
                )
        );

        /**
         * The constant HELP_NODE_TOGGLE_COLLAPSE.
         */
        public static final LangKeyValue HELP_NODE_TOGGLE_COLLAPSE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.node.toggle.collapse", ModPartEnum.MESSAGE,
                        "Collapse",
                        "折叠",
                        "折疊",
                        "收",  // 文言文：收起
                        true
                )
        );

        /**
         * The constant BASIC_HELP.
         */
        public static final LangKeyValue BASIC_HELP = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.basic.help", ModPartEnum.MESSAGE,
                        "Show Help Info",
                        "显示帮助信息",
                        "顯示幫助信息",
                        "示助之訊",  // 文言文：顯示幫助的訊息
                        true
                )
        );

        /**
         * The constant HELP_HOVER_COPY_TIP.
         */
        public static final LangKeyValue HELP_HOVER_COPY_TIP = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.help.hover.copy", ModPartEnum.MESSAGE,
                        "Copy to clipboard",
                        "点击复制",
                        "點擊複製",
                        "點之複刻",  // 文言文：點之複刻
                        true
                )
        );
        private static LangKeyValue addAndRet(LangKeyValue item) {
            items.add(item);
            return item;
        }

        /**
         * Gets items.
         *
         * @return the items
         */
        public static Set<LangKeyValue> getItems() {
            return items;
        }
    }

    /**
     * The Lang key values.
     */
    final List<LangKeyValue> langKeyValues = new ArrayList<>();


    /**
     * Init lang key values.
     */
    public void initLangKeyValues() {
       Message.getItems().forEach(this::addLang);
        LangKeyValue dollName = LangKeyValue.ofSupplier(
                Lib39Items.DOLL, ModPartEnum.ITEM,
                "Doll", "人偶", "人偶", "偶", false
        );
        addLang(dollName);
        addLang(LangKeyValue.copyOf(
                Lib39Blocks.DOLL, ModPartEnum.BLOCK, dollName
        ));
        addLang(LangKeyValue.ofKey(
                "tooltip.lib39.content.doll.hover.1", ModPartEnum.DESCRIPTION,
                "§eSkinOwner §7:§a %s ", "§e皮肤所有者§7:§a%s", "§e皮膚所有者§7:§a%s", "§e膚主§7:§a%s"
        ));
        addLang(LangKeyValue.ofKey(
                "tooltip.lib39.content.doll.hover.2", ModPartEnum.DESCRIPTION,
                "§7Rename with a player name in an anvil to change skin",
                "§7在铁砧上可通过重命名对应玩家名来改变皮肤", "§7在鐵砧上可通過重命名對應玩家名來改變皮膚", "§7鐵砧之上，更名以易膚"
        ));
        addLang(LangKeyValue.ofKey(
                "invalid.player_name.too_long", ModPartEnum.DESCRIPTION,
                "§c§lPlayer 's Name is too long than 16 characters.",
                "§c§l玩家名称过长（最多16个字符）", "§c§l玩家名稱過長（最多16個字符）", "§c§l玩家名過長，限十六字"
        ));
        if (Lib39.shouldRegisterExamples()) {
            addLang(LangKeyValue.ofSupplier(
                    ExLib39Items.FABRIC, ModPartEnum.ITEM,
                    "Fabric", "织布", "織布", "織", true
            ));
            addLang(LangKeyValue.ofSupplier(
                    ExLib39Items.NEOFORGE, ModPartEnum.ITEM,
                    "NeoForge", "小狐狸", "狐狸", "狸", true
            ));
            addLang(LangKeyValue.ofSupplier(
                    ExLib39Items.FORGE, ModPartEnum.ITEM,
                    "Forge", "铁砧", "铁砧", "砧", true
            ));
            TestMessage.getItems().forEach(this::addLang);
        }
    }


    /**
     * Add lang.
     *
     * @param keyValue the key value
     */
    public void addLang(LangKeyValue keyValue) {
        langKeyValues.add(keyValue);
    }

    /**
     * Clear.
     */
    public void clear() {
        langKeyValues.clear();
    }


    @Contract(pure = true)
    @Override
    public @Unmodifiable List<LangKeyValue> getValues() {
        return List.copyOf(langKeyValues);
    }

    /**
     * The type Test message.
     */
    @SuppressWarnings("unused")
    public static final class TestMessage {
        private static final Set<LangKeyValue> items = new HashSet<>();

        // ===== lib39 測試命令翻譯 =====

        /**
         * The constant LIB39_ROOT.
         */
// 根命令
        public static final LangKeyValue LIB39_ROOT = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.root", ModPartEnum.MESSAGE,
                        "Lib39 Command System",
                        "Lib39 命令系統",
                        "Lib39 指令系統",
                        "Lib39 令系",
                        true
                )
        );

        /**
         * The constant LIB39_TEST.
         */
// 測試命令
        public static final LangKeyValue LIB39_TEST = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.test", ModPartEnum.MESSAGE,
                        "Test command",
                        "測試命令",
                        "測試指令",
                        "試令",
                        true
                )
        );

        /**
         * The constant LIB39_TEST_SUCCESS.
         */
        public static final LangKeyValue LIB39_TEST_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.test.success", ModPartEnum.MESSAGE,
                        "Test command executed successfully!",
                        "測試命令執行成功！",
                        "測試指令執行成功！",
                        "試令行成！",
                        true
                )
        );

        /**
         * The constant LIB39_TEST_WITH_PARAM.
         */
        public static final LangKeyValue LIB39_TEST_WITH_PARAM = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.test.with_param", ModPartEnum.MESSAGE,
                        "Test command with parameter: %s",
                        "帶參數的測試命令：%s",
                        "帶參數的測試指令：%s",
                        "帶參試令：%s",
                        true
                )
        );

        /**
         * The constant LIB39_DEMO.
         */
        public static final LangKeyValue LIB39_DEMO = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.demo", ModPartEnum.MESSAGE,
                        "Demo command",
                        "演示命令",
                        "演示指令",
                        "演令",
                        true
                )
        );

        /**
         * The constant LIB39_DEMO_MESSAGE.
         */
        public static final LangKeyValue LIB39_DEMO_MESSAGE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.demo.message", ModPartEnum.MESSAGE,
                        "This is a demo command showing Lib39 features!",
                        "這是一個展示 Lib39 功能的演示命令！",
                        "這是一個展示 Lib39 功能的演示指令！",
                        "此乃展 Lib39 能之演令！",
                        true
                )
        );

        /**
         * The constant LIB39_GREET_BASIC.
         */
// 問候命令
        public static final LangKeyValue LIB39_GREET_BASIC = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.greet.basic", ModPartEnum.MESSAGE,
                        "Greet everyone",
                        "向大家問好",
                        "向大家問好",
                        "問眾安",
                        true
                )
        );

        /**
         * The constant LIB39_GREET_DEFAULT.
         */
        public static final LangKeyValue LIB39_GREET_DEFAULT = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.greet.default", ModPartEnum.MESSAGE,
                        "Hello everyone from Lib39!",
                        "來自 Lib39 的問候！",
                        "來自 Lib39 的問候！",
                        "自 Lib39 問安！",
                        true
                )
        );

        /**
         * The constant LIB39_GREET_PLAYER.
         */
        public static final LangKeyValue LIB39_GREET_PLAYER = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.greet.player", ModPartEnum.MESSAGE,
                        "Greet specific player",
                        "問候特定玩家",
                        "問候特定玩家",
                        "問特者安",
                        true
                )
        );

        /**
         * The constant LIB39_GREET_RECEIVED.
         */
        public static final LangKeyValue LIB39_GREET_RECEIVED = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.greet.received", ModPartEnum.MESSAGE,
                        "%s greeted you!",
                        "%s 向你問好！",
                        "%s 向你問好！",
                        "%s 問汝安！",
                        true
                )
        );

        /**
         * The constant LIB39_CALCULATE.
         */
// 計算命令
        public static final LangKeyValue LIB39_CALCULATE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.calculate", ModPartEnum.MESSAGE,
                        "Calculate sum of two numbers",
                        "計算兩個數字的和",
                        "計算兩個數字的和",
                        "算二數和",
                        true
                )
        );

        /**
         * The constant LIB39_CALCULATE_RESULT.
         */
        public static final LangKeyValue LIB39_CALCULATE_RESULT = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.calculate.result", ModPartEnum.MESSAGE,
                        "%d + %d = %d",
                        "%d + %d = %d",
                        "%d + %d = %d",
                        "%d 加 %d 等 %d",
                        true
                )
        );

        /**
         * The constant LIB39_TELEPORT.
         */
// 傳送命令
        public static final LangKeyValue LIB39_TELEPORT = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.teleport", ModPartEnum.MESSAGE,
                        "Teleport to player (OP only)",
                        "傳送到玩家（僅OP）",
                        "傳送到玩家（僅OP）",
                        "送至者（唯管）",
                        true
                )
        );

        /**
         * The constant LIB39_TELEPORT_SUCCESS.
         */
        public static final LangKeyValue LIB39_TELEPORT_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.teleport.success", ModPartEnum.MESSAGE,
                        "Teleported to %s",
                        "已傳送至 %s",
                        "已傳送至 %s",
                        "已送至 %s",
                        true
                )
        );

        /**
         * The constant LIB39_INFO.
         */
// 信息命令
        public static final LangKeyValue LIB39_INFO = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.info", ModPartEnum.MESSAGE,
                        "Show player information",
                        "顯示玩家信息",
                        "顯示玩家資訊",
                        "示者訊",
                        true
                )
        );

        /**
         * The constant LIB39_INFO_MESSAGE.
         */
        public static final LangKeyValue LIB39_INFO_MESSAGE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.info.message", ModPartEnum.MESSAGE,
                        "=== Player Information ===",
                        "=== 玩家信息 ===",
                        "=== 玩家資訊 ===",
                        "〇〇 者訊 〇〇",
                        true
                )
        );

        /**
         * The constant LIB39_INFO_DIMENSION.
         */
        public static final LangKeyValue LIB39_INFO_DIMENSION = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.info.dimension", ModPartEnum.MESSAGE,
                        "Dimension: %s",
                        "維度：%s",
                        "維度：%s",
                        "界：%s",
                        true
                )
        );

        /**
         * The constant LIB39_INFO_POSITION.
         */
        public static final LangKeyValue LIB39_INFO_POSITION = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.info.position", ModPartEnum.MESSAGE,
                        "Position: X=%.1f, Y=%.1f, Z=%.1f",
                        "位置：X=%.1f, Y=%.1f, Z=%.1f",
                        "位置：X=%.1f, Y=%.1f, Z=%.1f",
                        "位：X=%.1f, Y=%.1f, Z=%.1f",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM.
         */
// 隊伍系統
        public static final LangKeyValue LIB39_TEAM = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team", ModPartEnum.MESSAGE,
                        "Team management",
                        "隊伍管理",
                        "隊伍管理",
                        "隊管",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_CREATE.
         */
        public static final LangKeyValue LIB39_TEAM_CREATE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.create", ModPartEnum.MESSAGE,
                        "Create a new team",
                        "創建新隊伍",
                        "創建新隊伍",
                        "創新隊",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_CREATE_SUCCESS.
         */
        public static final LangKeyValue LIB39_TEAM_CREATE_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.create.success", ModPartEnum.MESSAGE,
                        "Team '%s' created successfully!",
                        "隊伍 '%s' 創建成功！",
                        "隊伍 '%s' 創建成功！",
                        "隊 '%s' 創新成！",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_JOIN.
         */
        public static final LangKeyValue LIB39_TEAM_JOIN = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.join", ModPartEnum.MESSAGE,
                        "Join a team",
                        "加入隊伍",
                        "加入隊伍",
                        "入隊",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_JOIN_SUCCESS.
         */
        public static final LangKeyValue LIB39_TEAM_JOIN_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.join.success", ModPartEnum.MESSAGE,
                        "Joined team '%s'",
                        "已加入隊伍 '%s'",
                        "已加入隊伍 '%s'",
                        "已入隊 '%s'",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_LEAVE.
         */
        public static final LangKeyValue LIB39_TEAM_LEAVE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.leave", ModPartEnum.MESSAGE,
                        "Leave current team",
                        "離開當前隊伍",
                        "離開當前隊伍",
                        "離現隊",
                        true
                )
        );

        /**
         * The constant LIB39_TEAM_LEAVE_SUCCESS.
         */
        public static final LangKeyValue LIB39_TEAM_LEAVE_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.team.leave.success", ModPartEnum.MESSAGE,
                        "Left the team",
                        "已離開隊伍",
                        "已離開隊伍",
                        "已離隊",
                        true
                )
        );

        /**
         * The constant LIB39_GAME.
         */
// 遊戲系統
        public static final LangKeyValue LIB39_GAME = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game", ModPartEnum.MESSAGE,
                        "Game control",
                        "遊戲控制",
                        "遊戲控制",
                        "戲控",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_START.
         */
        public static final LangKeyValue LIB39_GAME_START = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.start", ModPartEnum.MESSAGE,
                        "Start a game",
                        "開始遊戲",
                        "開始遊戲",
                        "啟戲",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_START_SUCCESS.
         */
        public static final LangKeyValue LIB39_GAME_START_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.start.success", ModPartEnum.MESSAGE,
                        "Game '%s' started!",
                        "遊戲 '%s' 已開始！",
                        "遊戲 '%s' 已開始！",
                        "戲 '%s' 已啟！",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_STOP.
         */
        public static final LangKeyValue LIB39_GAME_STOP = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.stop", ModPartEnum.MESSAGE,
                        "Stop current game",
                        "停止當前遊戲",
                        "停止當前遊戲",
                        "止現戲",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_STOP_SUCCESS.
         */
        public static final LangKeyValue LIB39_GAME_STOP_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.stop.success", ModPartEnum.MESSAGE,
                        "Game stopped!",
                        "遊戲已停止！",
                        "遊戲已停止！",
                        "戲已止！",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_PAUSE.
         */
        public static final LangKeyValue LIB39_GAME_PAUSE = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.pause", ModPartEnum.MESSAGE,
                        "Pause current game",
                        "暫停當前遊戲",
                        "暫停當前遊戲",
                        "暫現戲",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_PAUSE_SUCCESS.
         */
        public static final LangKeyValue LIB39_GAME_PAUSE_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.pause.success", ModPartEnum.MESSAGE,
                        "Game paused!",
                        "遊戲已暫停！",
                        "遊戲已暫停！",
                        "戲已暫！",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_RESUME.
         */
        public static final LangKeyValue LIB39_GAME_RESUME = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.resume", ModPartEnum.MESSAGE,
                        "Resume paused game",
                        "恢復暫停的遊戲",
                        "恢復暫停的遊戲",
                        "復暫戲",
                        true
                )
        );

        /**
         * The constant LIB39_GAME_RESUME_SUCCESS.
         */
        public static final LangKeyValue LIB39_GAME_RESUME_SUCCESS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.game.resume.success", ModPartEnum.MESSAGE,
                        "Game resumed!",
                        "遊戲已恢復！",
                        "遊戲已恢復！",
                        "戲已復！",
                        true
                )
        );

        /**
         * The constant LIB39_SETTINGS.
         */
// 設置命令
        public static final LangKeyValue LIB39_SETTINGS = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.settings", ModPartEnum.MESSAGE,
                        "Show settings",
                        "顯示設置",
                        "顯示設定",
                        "示置",
                        true
                )
        );

        /**
         * The constant LIB39_CONFIG.
         */
        public static final LangKeyValue LIB39_CONFIG = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.config", ModPartEnum.MESSAGE,
                        "Show configuration",
                        "顯示配置",
                        "顯示設定",
                        "示配",
                        true
                )
        );

        /**
         * The constant LIB39_RELOAD.
         */
        public static final LangKeyValue LIB39_RELOAD = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.reload", ModPartEnum.MESSAGE,
                        "Reload configuration",
                        "重新加載配置",
                        "重新載入設定",
                        "重載配",
                        true
                )
        );

        /**
         * The constant LIB39_DEBUG.
         */
        public static final LangKeyValue LIB39_DEBUG = addAndRet(
                LangKeyValue.ofKey(
                        "commands.lib39.debug", ModPartEnum.MESSAGE,
                        "Debug information",
                        "調試信息",
                        "除錯資訊",
                        "調訊",
                        true
                )
        );

        // ===== 添加缺失的導入 =====
        private static final java.util.function.Consumer<LangKeyValue> addConsumer = items::add;

        private static LangKeyValue addAndRet(LangKeyValue item) {
            items.add(item);
            return item;
        }

        /**
         * Gets items.
         *
         * @return the items
         */
        public static Set<LangKeyValue> getItems() {
            return items;
        }
    }

}
