package org.poopki.duckdns.user_db.Bank; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; 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; public class AccountGUIEvent implements Listener,CommandExecutor { AccountArray m_AccountArray; UserInfoArray m_UserInfoArray; FarmArray m_FarmArray; NationArray m_NationArray; SquadArray m_SquadArray; public AccountGUIEvent(UserInfoArray m_UIA, FarmArray FA, NationArray NA, SquadArray SA, AccountArray AA){ m_UserInfoArray = m_UIA; m_AccountArray = AA; m_FarmArray = FA; m_NationArray = NA; m_SquadArray = SA; } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if(sender instanceof Player){ Player player = (Player) sender; player.sendMessage("이벤트 발생"); AccountGUI inv = new AccountGUI(m_AccountArray,m_UserInfoArray,m_FarmArray,m_NationArray, m_SquadArray,((Player) sender).getUniqueId(), null); inv.open(player); } return false; } @EventHandler public boolean inven_Bank(InventoryClickEvent e){ Player player = (Player) e.getWhoClicked();; String name = e.getView().getTitle(); player.sendMessage("이벤트 발생B"); if(name.equals(":offset_-8::bank_main:")){ if(e.getCurrentItem()!=null){ e.setCancelled(true); AccountGUI inv = new AccountGUI(m_AccountArray,m_UserInfoArray,m_FarmArray,m_NationArray, m_SquadArray, player.getUniqueId(), e); inv.inven(e); return true; } } return false; } }