Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void invClickEvent(InventoryClickEvent e) {
- ItemStack kitselector = new ItemStack(Material.COMPASS);
- ArrayList<String> kitselectorLore = new ArrayList<String>();
- ItemMeta kitselectorMeta = kitselector.getItemMeta();
- kitselectorMeta.setDisplayName("§a§lKit Selector");
- kitselectorLore.add("§8-----");
- kitselectorLore.add("§aSelect your kit!");
- kitselectorMeta.setLore(kitselectorLore);
- kitselector.setItemMeta(kitselectorMeta);
- final Player p = (Player) e.getWhoClicked();
- PlayerInventory pi = p.getInventory();
- // getLogger().info("BASIC("+e.getCurrentItem().getItemMeta().getDisplayName()+")="+e.getCurrentItem().getItemMeta().getDisplayName().contains("Basic"));
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§bBasic")) {
- e.setCancelled(true);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§3Knight Kit")) {
- e.setCancelled(true);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§cImperialArmor")) {
- e.setCancelled(true);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§eEpic")) {
- e.setCancelled(true);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§oHello")) {
- e.setCancelled(true);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§a§lConfirm Leather")) {
- e.setCancelled(true);
- p.closeInventory();
- pi.remove(kitselector);
- leatherKit(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§a§lConfirm Epic")) {
- e.setCancelled(true);
- p.closeInventory();
- pi.remove(kitselector);
- EpicKit(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§c§lDeny")) {
- e.setCancelled(true);
- p.closeInventory();
- mainGUI(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§a§lConfirm Knight")) {
- e.setCancelled(true);
- p.closeInventory();
- pi.remove(kitselector);
- knightKit(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§a§lConfirm Imperial")) {
- e.setCancelled(true);
- p.closeInventory();
- pi.remove(kitselector);
- ImperialKit(p);
- }
- // Name of who clicked
- String clicked = e.getWhoClicked().getName();
- // ------------------
- if (e.getInventory().getName() != "§aKits") {
- return;
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§7Peasant")) {
- e.setCancelled(true);
- leatherGUI(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§3Knight")) {
- e.setCancelled(true);
- knightGUI(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§cImperial")) {
- e.setCancelled(true);
- imperialGUI(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName()
- .contains("§eEpic Kit")) {
- e.setCancelled(true);
- epicGUI(p);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement