package org.poopki.duckdns.user_db.GUI; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.poopki.duckdns.user_db.Array.AccountArray; import org.poopki.duckdns.user_db.Array.FarmArray; import org.poopki.duckdns.user_db.Array.NationArray; import org.poopki.duckdns.user_db.Array.SquadArray; import org.poopki.duckdns.user_db.UserInfoArray; import java.util.Arrays; import java.util.UUID; public class ItemManager { UUID ZERO_UUID = new UUID(0,0); public ItemStack btn1 = buildItem(Material.CANDLE, 1, ChatColor.AQUA +"지갑 10000원 증가", "", ChatColor.GREEN + "----"); public ItemStack btn2 = buildItem(Material.BEEF, 1, ChatColor.AQUA +"지갑 10000원 감소", "", ChatColor.GREEN + "----"); public ItemStack btn3 = buildItem(Material.TORCH, 1, ChatColor.AQUA +"국가 10000원 증가", "", ChatColor.GREEN + "----"); public ItemStack btn4 = buildItem(Material.GRASS, 1, ChatColor.AQUA +"국가 10000원 감소", "", ChatColor.GREEN + "----"); public ItemStack btn5 = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +"농장 10000원 증가", "", ChatColor.GREEN + "----"); public ItemStack btn6 = buildItem(Material.IRON_INGOT, 1, ChatColor.AQUA +"농장 10000원 증가", "", ChatColor.GREEN + "----"); private static ItemStack buildItem(Material type, int amount, String displayName, String... lore) { ItemStack stack = new ItemStack(type, amount); ItemMeta meta = stack.getItemMeta(); meta.setDisplayName(displayName); meta.setLore(Arrays.asList(lore)); stack.setItemMeta(meta); return stack; } public ItemStack GetBalance(AccountArray AA, UserInfoArray UIA, FarmArray FA, NationArray NA, SquadArray SA, UUID m_uuid, String Type){ ItemStack dia = null; switch (Type){ case "User": dia = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +""+UIA.getUserName(m_uuid), "잔액", ChatColor.GREEN + ""+AA.getAccountInfo(m_uuid)); break; case "Farm": if(ZERO_UUID.equals(UIA.getUserGroupUUID(m_uuid, "Farm"))){ dia = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +"농장 없음", "잔액", ChatColor.GREEN + "----"); }else{ dia = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +""+FA.GetGroupName(UIA.getUserGroupUUID(m_uuid,"Farm")), "잔액", ChatColor.GREEN + ""+AA.getAccountInfo(UIA.getUserGroupUUID(m_uuid, "Farm"))); } break; case "Nation": if(ZERO_UUID.equals(UIA.getUserGroupUUID(m_uuid, "Nation"))){ dia = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +"국가 없음", "잔액", ChatColor.GREEN + "----"); } else{ dia = buildItem(Material.DIAMOND, 1, ChatColor.AQUA +""+NA.GetGroupName(UIA.getUserGroupUUID(m_uuid, "Nation")), "잔액", ChatColor.GREEN + ""+AA.getAccountInfo(UIA.getUserGroupUUID(m_uuid, "Nation"))); } break; } return dia; } }