package org.poopki.duckdns.user_db.Array; import dev.lone.itemsadder.api.CustomStack; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitRunnable; import org.poopki.duckdns.user_db.Research.Research; import java.util.*; public class Nation extends Group{ String[] techtree = {"agriculture","pottery","animal_husbandry","archery","mining","sailing","calendar","writing","trapping","wheel","masonry","bronze","optics","horseback","mathematics","construction","philosophy","drama","currency","engineering","iron_working","theology","civil_service","guilds","metal_casting","compass","education","chivalry","machinery","physics","steel","astronomy","acoustics","banking","printing_press","gunpowder","navigation","architecture","economics","metallurgy","chemistry","archaeology","scientific_theory","industrialization","rifling","military_science","fertilizer","biology","electricity","steam_power","dynamite","refrigeration","radio","flight","railroad","plastics","electronics","ballistics","combustion","penicillin","atomic_theory","radar","combined_arms","ecology","nuclear_fission","rocketry","computers","telecommunications","mobile_tactics","advanced_ballistics","satellites","robotics","lasers","the_internet","globalization","particle_physics","nuclear_fusion","nanotechnology","stealth"}; public Nation(String Name, List uuid_list, Plugin plugin){ super(Name, uuid_list); for(int i = 0; i<3; i++){ m_ResearchArray.add(new Research("연구 테스트",plugin, m_MemberList)); //연구 프로그레스바 등록 } //Init 테크트리 for(String Key: techtree){ InitTechTree(Key,0); } new BukkitRunnable(){ @Override public void run(){ for(Research key:m_ResearchArray){ for(UUID uuid: Nation.super.getGroupMembers()){ if(Bukkit.getPlayer(uuid)!=null){ key.tech1_progressbar.addPlayer(Bukkit.getPlayer(uuid)); } } } } }.runTaskTimer(plugin,0,20); //InitResearchItem(); } public void InitResearchItem(){ //System.out.println(CustomStack.getInstance("research:materials-book").getDisplayName()); ArrayList InitStack = new ArrayList(); InitStack.add(CustomStack.getInstance("research:materials-book").getItemStack()); InitStack.add(CustomStack.getInstance("research:materials-crystal").getItemStack()); InitStack.add(CustomStack.getInstance("research:materials-god_pot").getItemStack()); m_ResearchArray.get(0).SetMaterials(InitStack); // 0-> 고대 연구 아이템 설정 } public void AddShowResearchProgressBar(Integer index, Player player){ m_ResearchArray.get(index).tech1_progressbar.addPlayer(player); } public void ShowResearchProgressBar(Integer index, boolean toggle){ m_ResearchArray.get(index).tech1_progressbar.setVisible(toggle); } }