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.
65 lines
2.4 KiB
65 lines
2.4 KiB
2 years ago
|
package org.poopki.duckdns.user_db.GUI;
|
||
|
|
||
|
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;
|
||
|
|
||
|
import java.util.UUID;
|
||
|
|
||
|
|
||
|
public class TechGUIEvent implements Listener,CommandExecutor {
|
||
|
AccountArray m_AccountArray;
|
||
|
UserInfoArray m_UserInfoArray;
|
||
|
FarmArray m_FarmArray;
|
||
|
NationArray m_NationArray;
|
||
|
SquadArray m_SquadArray;
|
||
|
UUID ZERO_UUID = new UUID(0,0);
|
||
|
public TechGUIEvent(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){
|
||
|
if(ZERO_UUID.equals(m_UserInfoArray.getUserGroupUUID(((Player) sender).getUniqueId(), "Nation"))){
|
||
|
Player player = (Player) sender;
|
||
|
player.sendMessage("국가에 소속된 유저만 사용이 가능");
|
||
|
}
|
||
|
else{
|
||
|
Player player = (Player) sender;
|
||
|
player.sendMessage("TECH: "+player.getUniqueId());
|
||
|
player.sendMessage("TECH: "+m_UserInfoArray.getUserGroupUUID(player.getUniqueId(),"Nation"));
|
||
|
player.sendMessage("TECH: "+m_NationArray.GetGroupTechTree(m_UserInfoArray.getUserGroupUUID(player.getUniqueId(),"Nation"),"agriculture"));
|
||
|
|
||
|
TechGUI inv = new TechGUI(m_AccountArray,m_UserInfoArray,m_FarmArray,m_NationArray, m_SquadArray,player.getUniqueId(), null);
|
||
|
|
||
|
inv.open(player);
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
@EventHandler
|
||
|
public void inven2(InventoryClickEvent e){
|
||
|
Player player = (Player) e.getWhoClicked();;
|
||
|
player.sendMessage("이벤트 발생");
|
||
|
TechGUI inv = new TechGUI(m_AccountArray,m_UserInfoArray,m_FarmArray,m_NationArray, m_SquadArray, player.getUniqueId(), e);
|
||
|
inv.inven(e);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|