package org.poopki.duckdns.user_db.Research; import dev.lone.itemsadder.api.CustomStack; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.boss.*; import org.poopki.duckdns.user_db.Array.Account; import org.poopki.duckdns.user_db.Array.NationArray; import org.poopki.duckdns.user_db.UserInfoArray; import java.sql.SQLException; import java.util.*; public class Research { public Inventory research_tab; public String m_title; public Double m_progress=0.0; public ArrayList m_material = new ArrayList(); public BossBar tech1_progressbar; public Integer research_point=0; public Research(String title, Plugin plugin, ListMemberList) { research_tab = Bukkit.createInventory(null, 54, title); tech1_progressbar = Bukkit.createBossBar(m_title, BarColor.BLUE,BarStyle.SOLID); new BukkitRunnable(){ @Override public void run(){ if(CheckItem()){ if(1<=m_progress) { research_point = research_point+1; m_progress = 0.0; for(UUID key: MemberList){ if(Bukkit.getPlayer(key) != null){ Bukkit.getPlayer(key).sendMessage("국가의 연구가 완료되었습니다."); } } }else{ System.out.println(m_progress); m_progress = m_progress + 0.2; } } tech1_progressbar.setProgress(m_progress); for(Player p: tech1_progressbar.getPlayers()){ } } }.runTaskTimer(plugin,0,20); } public void SetMaterials(ArrayList m_material){ for(ItemStack Key: m_material){ this.m_material.add(Key); } } public Inventory getInventory(){ return research_tab; } private boolean CheckItem() { if(0