You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
5.2 KiB

1 year ago
package org.poopki.duckdns.user_db.TechTree;
import dev.lone.itemsadder.api.CustomStack;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
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;
1 year ago
import org.poopki.duckdns.user_db.GUI.ItemManager;
import org.poopki.duckdns.user_db.UserInfoArray;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public class TechGUI implements Listener{
private final Inventory inv;
UUID m_uuid;
ItemManager m_ItemManager = new ItemManager();
AccountArray m_AA;
UserInfoArray m_UIA;
FarmArray m_FA;
NationArray m_NA;
SquadArray m_SA;
public TechGUI(AccountArray AA, UserInfoArray UIA, FarmArray FA, NationArray NA, SquadArray SA, UUID uuid, InventoryClickEvent e) {
m_uuid=uuid;
this.inv = Bukkit.createInventory(null,54,":offset_-8::ancient_era:");
m_AA = AA;
m_UIA = UIA;
m_FA = FA;
m_NA = NA;
m_SA = SA;
initItemSetting();
}
private void initItemSetting() {
/*
inv.setItem(0,m_ItemManager.GetBalance(m_AA, m_UIA, m_FA, m_NA,m_SA,m_uuid, "User"));
inv.setItem(1,m_ItemManager.GetBalance(m_AA, m_UIA, m_FA, m_NA,m_SA,m_uuid, "Nation"));
inv.setItem(2,m_ItemManager.GetBalance(m_AA, m_UIA, m_FA, m_NA,m_SA,m_uuid, "Farm"));
inv.setItem(9, m_ItemManager.btn1);
inv.setItem(18, m_ItemManager.btn2);
inv.setItem(10, m_ItemManager.btn3);
inv.setItem(19, m_ItemManager.btn4);
inv.setItem(11, m_ItemManager.btn5);
inv.setItem(20, m_ItemManager.btn6);
CustomStack stack = CustomStack.getInstance("digits:digit-zero");
ItemStack itemStack = stack.getItemStack();
*/
inv.setItem(27, CustomStack.getInstance("techtree:agriculture_"+ Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"agriculture"))).getItemStack());
inv.setItem(20, CustomStack.getInstance("techtree:pottery_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"pottery"))).getItemStack());
inv.setItem(29, CustomStack.getInstance("techtree:archery_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"archery"))).getItemStack());
inv.setItem(38, CustomStack.getInstance("techtree:mining_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"mining"))).getItemStack());
inv.setItem(13, CustomStack.getInstance("techtree:animal_husbandry_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"animal_husbandry"))).getItemStack());
inv.setItem(22, CustomStack.getInstance("techtree:writing_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"writing"))).getItemStack());
inv.setItem(31, CustomStack.getInstance("techtree:masonry_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"masonry"))).getItemStack());
inv.setItem(40, CustomStack.getInstance("techtree:bronze_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"bronze"))).getItemStack());
inv.setItem(15, CustomStack.getInstance("techtree:calendar_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"calendar"))).getItemStack());
inv.setItem(24, CustomStack.getInstance("techtree:trapping_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"trapping"))).getItemStack());
inv.setItem(33, CustomStack.getInstance("techtree:writing_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"writing"))).getItemStack());
inv.setItem(42, CustomStack.getInstance("techtree:wheel_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"wheel"))).getItemStack());
inv.setItem(51, CustomStack.getInstance("techtree:optics_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"optics"))).getItemStack());
inv.setItem(17, CustomStack.getInstance("techtree:sailing_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"sailing"))).getItemStack());
inv.setItem(26, CustomStack.getInstance("techtree:mathematics_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"mathematics"))).getItemStack());
inv.setItem(35, CustomStack.getInstance("techtree:construction_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"construction"))).getItemStack());
inv.setItem(44, CustomStack.getInstance("techtree:horseback_"+Integer.toString(m_NA.GetGroupTechTree(m_UIA.getUserGroupUUID(m_uuid,"Nation"),"horseback"))).getItemStack());
}
public void open(Player player){
player.openInventory(inv);
}
public void inven(InventoryClickEvent e){
Player p = (Player) e.getWhoClicked();
Inventory m_inv = e.getClickedInventory();
}
}