package com.leisuretimedock.blasttravelreborn.datagen.value;

import com.leisuretimedock.blasttravelreborn.BlastTravelReborn;
import com.leisuretimedock.blasttravelreborn.content.item.BTRItems;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Unmodifiable;
import top.r3944realms.lib39.datagen.value.ILangKeyValueCollection;
import top.r3944realms.lib39.datagen.value.LangKeyValue;
import top.r3944realms.lib39.datagen.value.ModPartEnum;

import java.util.ArrayList;
import java.util.List;

public enum BTRLangKeys implements ILangKeyValueCollection {
    INSTANCE;
    BTRLangKeys() {
        initLangKeyValues();
    }

    final List<LangKeyValue> langKeyValues = new ArrayList<>();
    public void initLangKeyValues() {
        addLang(LangKeyValue.ofSupplier(
                BTRItems.CANNON_ITEM, ModPartEnum.ITEM,
                "Cannon",
                "大炮",
                "大砲",  
                true
        ));
        addLang(LangKeyValue.ofKey(
                ModPartEnum.ENTITY.getFullKey(BlastTravelReborn.MOD_ID, "cannon"), ModPartEnum.ENTITY,
                "Cannon",
                "大炮",
                "大砲"  
        ));
        addLang(LangKeyValue.ofKey(
                "container.blasttravelreborn.cannon_container_menu", ModPartEnum.GUI,
                "Cannon",
                "大炮实体",
                "大砲實體"  
        ));
        addLang(LangKeyValue.ofKey(
                "death.attack.blasttravelreborn.cannon", ModPartEnum.MESSAGE,
                "%s was knocked out by a flying %s",
                "%s被飞行的%s击倒了",
                "%s被飛行的%s擊倒了"  
        ));
        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.full_cannon", ModPartEnum.MESSAGE,
                "Cannon is full!",
                "大炮已装满！",
                "大砲已裝滿！"  
        ));
        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.no_gunpowder", ModPartEnum.MESSAGE,
                "Cannon has no gunpowder!",
                "大炮没有火药了！",
                "大砲沒有火藥了！"  
        ));
        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.add_gunpowder_item", ModPartEnum.MESSAGE,
                "Added Gunpowder",
                "填充火药 (当前/最大): %d / %d",
                "填充火藥 (當前/最大): %d / %d"
        ));

        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.add_behavior_item", ModPartEnum.MESSAGE,
                "Added %s",
                "填充%s (当前/最大): %d / %d",
                "填充%s (當前/最大): %d / %d"
        ));

        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.add_lock_chain_item", ModPartEnum.MESSAGE,
                "Cannon Locked",
                "添加大炮锁链",
                "添加大砲鎖鏈"
        ));

        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.remove_lock_chain_item", ModPartEnum.MESSAGE,
                "Cannon Unlocked",
                "移除大炮锁链",
                "移除大砲鎖鏈"
        ));

        addLang(LangKeyValue.ofKey(
                "dialog.blasttravelreborn.fire", ModPartEnum.MESSAGE,
                "Fire",
                "发射",
                "發射"
        ));
        addLang(LangKeyValue.ofKey(
                "mount.blasttravelreborn.cannon.onboard", ModPartEnum.MESSAGE,
                "Press %s to Exit, or %s to Fire",
                "按%s离开，或按%s发射",
                "按%s離開，或按%s發射"  
        ));
   }

    public void addLang(LangKeyValue keyValue) {
        langKeyValues.add(keyValue);
   }

    public void clear() {
       langKeyValues.clear();
   }

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

}
