` @eventhandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
if (player == null) {
return;
}
ItemStack item = event.getCurrentItem();
ArmorStand stand = plugin.getPairedStand(player.getUniqueId());
if (stand == null) {
return;
}
String prefixMain = (ChatColor.DARK_BLUE + "Armorstand GUI");
String prefixOptions = (ChatColor.DARK_BLUE + "Armorstand GUI Options");
String prefixParent = (ChatColor.DARK_BLUE + "Armorstand Parent GUI Options");
if (event.getView().getTitle().equals(prefixMain) && !event.isCancelled()) {
if (event.getClickedInventory() != null && event.getView() != null && event.getView().getBottomInventory() != null && event.getClickedInventory().equals(event.getView().getBottomInventory())) {
return;
}
event.setCancelled(true);`
` @eventhandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {