
//**  1 带 主副手 后缀
//**  2 dzzl中分类剩下的
//**  3 aof的effect

//* tetra本体的effect
let tetra = [
    "tetra.stats.reach",
    "tetra.stats.attack_range",
    "tetra.stats.speed",
    "tetra.stats.draw_speed",
    "tetra.stats.draw_speed_normalized",
    "tetra.stats.ability_speed",
    "tetra.stats.ability_speed_normalized",
    "tetra.stats.speed_normalized",
    "tetra.stats.attack_damage",
    "tetra.stats.attack_damage_normalized",
    "tetra.stats.draw_strength",
    "tetra.stats.power",
    "tetra.stats.quick_charge",
    "tetra.stats.ability_damage",
    "tetra.stats.bleeding",
    "tetra.stats.backstab",
    "tetra.stats.armor",
    "tetra.stats.toughness",
    "tetra.stats.shieldbreaker",
    "tetra.stats.blocking",
    "tetra.stats.blocking_reflect",
    "tetra.stats.bashing",
    "tetra.stats.throwable",
    "tetra.stats.ricochet",
    "tetra.stats.piercing",
    "tetra.stats.piercing_harvest",
    "tetra.stats.jab",
    "tetra.stats.armorPenetration",
    "tetra.stats.crushing",
    "tetra.stats.skewering",
    "tetra.stats.stun",
    "tetra.stats.howling",
    "tetra.stats.ability_speed_bonus",
    "tetra.stats.ability_defensive",
    "tetra.stats.ability_overcharge",
    "tetra.stats.ability_momentum",
    "tetra.stats.ability_combo",
    "tetra.stats.ability_overextend",
    "tetra.stats.ability_exhilaration",
    "tetra.stats.ability_revenge",
    "tetra.stats.execute_revenge",
    "tetra.stats.puncture_revenge",
    "tetra.stats.ability_echo",
    "tetra.stats.execute",
    "tetra.stats.severing",
    "tetra.stats.lunge",
    "tetra.stats.slam",
    "tetra.stats.puncture",
    "tetra.stats.overpower",
    "tetra.stats.reap",
    "tetra.stats.pry_armor",
    "tetra.stats.knockback",
    "tetra.stats.looting",
    "tetra.stats.fiery",
    "tetra.stats.sharpness",
    "tetra.stats.smite",
    "tetra.stats.arthropod",
    "tetra.stats.sweeping",
    "tetra.stats.truesweep",
    "tetra.stats.unbreaking",
    "tetra.stats.mending",
    "tetra.stats.silkTouch",
    "tetra.stats.replanting",
    "tetra.stats.fortune",
    "tetra.stats.flame",
    "tetra.stats.punch",
    "tetra.stats.infinity",
    "tetra.stats.quickStrike",
    "tetra.stats.counterweight",
    "tetra.stats.softStrike",
    "tetra.stats.fierySelf",
    "tetra.stats.enderReverb",
    "tetra.stats.sculkTaint",
    "tetra.stats.toolbelt.quickslot",
    "tetra.stats.toolbelt.potion_storage",
    "tetra.stats.toolbelt.storage",
    "tetra.stats.toolbelt.quiver",
    "tetra.stats.toolbelt.booster",
    "tetra.stats.toolbelt.suspend_self",
    "tetra.stats.bow.releaseLatch",
    "tetra.stats.bow.overbowed",
    "tetra.stats.multishot",
    "tetra.stats.zoom",
    "tetra.stats.spread",
    "tetra.stats.focus",
    "tetra.stats.focusEcho",
    "tetra.stats.velocity",
    "tetra.stats.suspend",
    "tetra.stats.criticalStrike",
    "tetra.stats.holo_speed",
    "tetra.stats.holo.sweeperRange",
    "tetra.stats.holo.sweeperHorizontalSpread",
    "tetra.stats.holo.sweeperVerticalSpread",
    "tetra.stats.holo.percussionScanner",
    "tetra.stats.intuit",
    "tetra.stats.earthbind",
    "tetra.stats.reaching",
    "tetra.stats.tool.reaching_sweeping",
    "tetra.stats.janking",
    "tetra.stats.stability",
    "tetra.stats.stabilizing",
    "tetra.stats.unstable",
    "tetra.stats.workable",
    "tetra.stats.tool.breakdown",
    "tetra.stats.tool.enchantment_bonus",
    "tetra.stats.tool.striking",
    "tetra.stats.tool.sweeping",
    "tetra.stats.tool.truesweepingStrike",
    "tetra.stats.tool.planarSweep",
    "tetra.stats.tool.sweepingFocus",
    "tetra.stats.tool.extraction",
    "tetra.stats.tool.unboundExtraction",
    "tetra.stats.medialLimit",
    "tetra.stats.lateralLimit",
    "tetra.stats.axialLimit",
    "tetra.stats.integrity",
    "tetra.stats.integrity_usage"
]
//** 带中文
let tetra1 = [
    "tetra.stats.reach", "触及范围",
    "tetra.stats.attack_range", "攻击范围",
    "tetra.stats.durability", "耐久度",
    "tetra.stats.speed", "速度",
    "tetra.stats.draw_speed", "拉弓时间",
    "tetra.stats.draw_speed_normalized", "拉弓时间",
    "tetra.stats.ability_speed", "冷却时间",
    "tetra.stats.ability_speed_normalized", "冷却时间",
    "tetra.stats.speed_normalized", "速度",
    "tetra.stats.attack_damage", "伤害",
    "tetra.stats.attack_damage_normalized", "伤害",
    "tetra.stats.draw_strength", "强度",
    "tetra.stats.power", "力量附魔",
    "tetra.stats.quick_charge", "快速装填附魔",
    "tetra.stats.ability_damage", "伤害",
    "tetra.stats.bleeding", "流血",
    "tetra.stats.backstab", "背刺",
    "tetra.stats.armor", "护甲",
    "tetra.stats.toughness", "韧性",
    "tetra.stats.shieldbreaker", "破盾",
    "tetra.stats.blocking", "格挡",
    "tetra.stats.blocking_reflect", "反射",
    "tetra.stats.bashing", "猛击",
    "tetra.stats.throwable", "可投掷",
    "tetra.stats.ricochet", "弹射",
    "tetra.stats.piercing", "穿透",
    "tetra.stats.piercing_harvest", "穿透采集",
    "tetra.stats.jab", "刺击",
    "tetra.stats.armorPenetration", "穿透",
    "tetra.stats.crushing", "粉碎",
    "tetra.stats.skewering", "串刺",
    "tetra.stats.stun", "眩晕",
    "tetra.stats.howling", "嚎叫",
    "tetra.stats.ability_speed_bonus", "轻盈",
    "tetra.stats.ability_defensive", "防御姿态",
    "tetra.stats.ability_overcharge", "过载",
    "tetra.stats.ability_momentum", "动量",
    "tetra.stats.ability_combo", "连击",
    "tetra.stats.ability_overextend", "过度延伸",
    "tetra.stats.ability_exhilaration", "振奋",
    "tetra.stats.ability_revenge", "复仇",
    "tetra.stats.execute_revenge", "痛苦狂欢",
    "tetra.stats.puncture_revenge", "逆转",
    "tetra.stats.ability_echo", "回响",
    "tetra.stats.execute", "处决",
    "tetra.stats.severing", "切断",
    "tetra.stats.lunge", "突进",
    "tetra.stats.slam", "猛击",
    "tetra.stats.puncture", "穿刺",
    "tetra.stats.overpower", "压制",
    "tetra.stats.reap", "收割",
    "tetra.stats.pry_armor", "破甲",
    "tetra.stats.knockback", "击退",
    "tetra.stats.looting", "抢夺",
    "tetra.stats.fiery", "炽热",
    "tetra.stats.sharpness", "锋利附魔",
    "tetra.stats.smite", "亡灵杀手",
    "tetra.stats.arthropod", "节肢杀手",
    "tetra.stats.sweeping", "横扫",
    "tetra.stats.truesweep", "真横扫",
    "tetra.stats.unbreaking", "耐久",
    "tetra.stats.mending", "经验修补",
    "tetra.stats.silkTouch", "精准采集",
    "tetra.stats.replanting", "补种",
    "tetra.stats.fortune", "时运",
    "tetra.stats.flame", "火焰",
    "tetra.stats.punch", "冲击",
    "tetra.stats.infinity", "无限",
    "tetra.stats.quickStrike", "快速",
    "tetra.stats.counterweight", "配重",
    "tetra.stats.softStrike", "柔击",
    "tetra.stats.fierySelf", "炽焰",
    "tetra.stats.enderReverb", "回响",
    "tetra.stats.sculkTaint", "幽匿污染",
    "tetra.stats.toolbelt.quickslot", "快速槽位",
    "tetra.stats.toolbelt.potion_storage", "药水槽位",
    "tetra.stats.toolbelt.storage", "存储槽位",
    "tetra.stats.toolbelt.quiver", "箭袋槽位",
    "tetra.stats.toolbelt.booster", "助推强度",
    "tetra.stats.toolbelt.suspend_self", "悬浮",
    "tetra.stats.bow.releaseLatch", "释放锁扣",
    "tetra.stats.bow.overbowed", "过弓",
    "tetra.stats.multishot", "多重射击",
    "tetra.stats.zoom", "缩放",
    "tetra.stats.spread", "散布",
    "tetra.stats.focus", "聚焦",
    "tetra.stats.focusEcho", "回响",
    "tetra.stats.velocity", "速度",
    "tetra.stats.suspend", "悬浮",
    "tetra.stats.criticalStrike", "暴击",
    "tetra.stats.holo_speed", "冷却时间",
    "tetra.stats.holo.sweeperRange", "清扫范围",
    "tetra.stats.holo.sweeperHorizontalSpread", "水平清扫",
    "tetra.stats.holo.sweeperVerticalSpread", "垂直清扫",
    "tetra.stats.holo.percussionScanner", "冲击扫描器",
    "tetra.stats.intuit", "直觉",
    "tetra.stats.earthbind", "地缚",
    "tetra.stats.reaching", "延伸",
    "tetra.stats.tool.reaching_sweeping", "横扫",
    "tetra.stats.janking", "故障",
    "tetra.stats.magicCapacity", "魔法容量",
    "tetra.stats.stability", "稳定性",
    "tetra.stats.stabilizing", "稳定",
    "tetra.stats.unstable", "不稳定",
    "tetra.stats.workable", "可加工",
    "tetra.stats.tool.breakdown", "§7等级, §e%s\n \n§7效率, §e%s\n§7    基础, §e%s\n§7    挥舞速度, %s%s",
    "tetra.stats.tool.enchantment_bonus", "\n§7    附魔加成, §a+%s",
    "tetra.stats.tool.striking", "打击",
    "tetra.stats.tool.sweeping", "横扫",
    "tetra.stats.tool.truesweepingStrike", "真横扫",
    "tetra.stats.tool.planarSweep", "平面横扫",
    "tetra.stats.tool.sweepingFocus", "聚焦",
    "tetra.stats.tool.extraction", "提取器",
    "tetra.stats.tool.unboundExtraction", "无界提取器",
    "tetra.stats.medialLimit", "中间限制",
    "tetra.stats.lateralLimit", "横向限制",
    "tetra.stats.axialLimit", "轴向限制",
    "tetra.stats.integrity", "完整性",
    "tetra.stats.integrity_usage", "完整性使用, %s/%s",
    "tetra.stats.sorting.none", "无"
]

// global.all_effect.forEach(item => {
//     if (item && item.group) {
//         if (item.group.includes("mainhand") || item.group.includes("offhand")) {
//             effectNamesWithhand.push("tetra.stats." + item.effect_name)
//         }
//     }
// });
// JsonIO.jsjs$write('kubejs/startup_scripts/global/text.json', effectNamesWithhand);

let effectNamesWithhand = [
]
global.all_effect.forEach(item => {
    // 先判断 item 和 item.group 存在，避免空值报错
    if (item && item.group) {
        if (item.group.includes("mainhand") || item.group.includes("offhand")) {
            if (!effectNamesWithhand.includes("tetra.stats." + item.effect_name)) {
                effectNamesWithhand.push("tetra.stats." + item.effect_name);
            }
        }
    }
});

// 定义空数组用于存储结果
let effectNamesWithCuriosAndArmor = [];

// 遍历所有效果
global.all_effect.forEach(item => {
    // 先判断 item 和 item.group 存在，避免空值报错
    if (item && item.group) {
        // 检查 group 是否包含 "curios" 或 "armor"
        if (item.group.includes("curios") || item.group.includes("armor")) {

            if (!effectNamesWithCuriosAndArmor.includes("tetra.stats." + item.effect_name)){
                effectNamesWithCuriosAndArmor.push("tetra.stats." + item.effect_name);
            }
        }
    }
});

TetraJSEvents.registerStatBar(e => {

    let StatBarShowManager = Java.loadClass("net.yiran.extraholopage.api.StatBarShowManager").getInstance()
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    //Effect List
    //最近的修改，zh_cn中最新的effect为均衡
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    //*****************************************
    // 准备Group
    //黑名单
    //* 不在 饰品，护甲 上显示的：
    //**  1 带 主副手 后缀
    //**  2 dzzl中分类剩下的
    //**  3 aof的effect
    //**  4 tetra本体的effect
    StatBarShowManager.registerDestroyWithGroup.apply(StatBarShowManager,
        ["curios_and_weapon_blacklist"].concat(
            effectNamesWithhand,
            tetra
        )
    )
    //* 不在 锻造锤 上显示的：
    //**  1 同上
    //**  2 只带 饰品 后缀
    //**  3 只带 护甲 后缀
    //**  4 带 饰品&护甲 后缀
    StatBarShowManager.registerDestroyWithGroup.apply(StatBarShowManager,
        ["hammer_blacklist"].concat(
            effectNamesWithCuriosAndArmor
        )
    )
    //*****************************************


    //*****************************************
    //白名单
    // StatBarShowManager.registerAllowWithGroup("a", "tetra.stats.equilibrium", "tetra.stats.attack_damage"    
    // )
    //*****************************************



    //把物品加入Group
    //饰品，护甲，和锻造锤
    StatBarShowManager.addItemInGroup("curios_and_weapon_blacklist",
        "hp_dzzl:modular_head",
        "hp_dzzl:modular_chest",
        "hp_dzzl:modular_legs",
        "hp_dzzl:modular_feet",
        "tetra:chestplate",
        "tetra:helmet",
        "tetra:legging",
        "tetra:feet",
        "tetra:zai_bian_zhi_xin1",
        "tetra:zu_li_jian1",
        "tetra:huang_guan1",
        "tetra:ryzz",
        "tetra:hu_xin_jing1",
        "tetra:shou_tao1",
        "tetra:ring",
        "tetra:necklace",
        "tetra:dzzl_steam_engine",
        "tetra:yuan_chu_wen_chuang1",
        "tetra:biotoxin_bottles",
        "tetra:hammer_modular"
    )

    // addItemInGroup.addItemInGroup.apply(addItemInGroup,
    //     ["curios_And_Weapon_blacklist"].concat(
    //         curios,
    //         armor
    //     )
    // )
    //锻造锤
    StatBarShowManager.addItemInGroup("hammer_blacklist", "tetra:hammer_modular", "minecraft:dirt")
})

