Advertisement
Guest User

Umm

a guest
May 28th, 2015
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. @EventHandler
  2. public void invClickEvent(InventoryClickEvent e) {
  3.  
  4. ItemStack kitselector = new ItemStack(Material.COMPASS);
  5. ArrayList<String> kitselectorLore = new ArrayList<String>();
  6. ItemMeta kitselectorMeta = kitselector.getItemMeta();
  7. kitselectorMeta.setDisplayName("§a§lKit Selector");
  8. kitselectorLore.add("§8-----");
  9. kitselectorLore.add("§aSelect your kit!");
  10. kitselectorMeta.setLore(kitselectorLore);
  11. kitselector.setItemMeta(kitselectorMeta);
  12.  
  13. final Player p = (Player) e.getWhoClicked();
  14. PlayerInventory pi = p.getInventory();
  15. // getLogger().info("BASIC("+e.getCurrentItem().getItemMeta().getDisplayName()+")="+e.getCurrentItem().getItemMeta().getDisplayName().contains("Basic"));
  16.  
  17. if (e.getCurrentItem().getItemMeta().getDisplayName()
  18. .contains("§bBasic")) {
  19. e.setCancelled(true);
  20. }
  21.  
  22. if (e.getCurrentItem().getItemMeta().getDisplayName()
  23. .contains("§3Knight Kit")) {
  24. e.setCancelled(true);
  25. }
  26.  
  27. if (e.getCurrentItem().getItemMeta().getDisplayName()
  28. .contains("§cImperialArmor")) {
  29. e.setCancelled(true);
  30. }
  31.  
  32. if (e.getCurrentItem().getItemMeta().getDisplayName()
  33. .contains("§eEpic")) {
  34. e.setCancelled(true);
  35. }
  36.  
  37.  
  38. if (e.getCurrentItem().getItemMeta().getDisplayName()
  39. .contains("§oHello")) {
  40. e.setCancelled(true);
  41. }
  42.  
  43. if (e.getCurrentItem().getItemMeta().getDisplayName()
  44. .contains("§a§lConfirm Leather")) {
  45. e.setCancelled(true);
  46. p.closeInventory();
  47. pi.remove(kitselector);
  48. leatherKit(p);
  49. }
  50.  
  51. if (e.getCurrentItem().getItemMeta().getDisplayName()
  52. .contains("§a§lConfirm Epic")) {
  53. e.setCancelled(true);
  54. p.closeInventory();
  55. pi.remove(kitselector);
  56. EpicKit(p);
  57. }
  58.  
  59. if (e.getCurrentItem().getItemMeta().getDisplayName()
  60. .contains("§c§lDeny")) {
  61. e.setCancelled(true);
  62. p.closeInventory();
  63. mainGUI(p);
  64.  
  65. }
  66.  
  67. if (e.getCurrentItem().getItemMeta().getDisplayName()
  68. .contains("§a§lConfirm Knight")) {
  69. e.setCancelled(true);
  70. p.closeInventory();
  71. pi.remove(kitselector);
  72. knightKit(p);
  73. }
  74.  
  75. if (e.getCurrentItem().getItemMeta().getDisplayName()
  76. .contains("§a§lConfirm Imperial")) {
  77. e.setCancelled(true);
  78. p.closeInventory();
  79. pi.remove(kitselector);
  80. ImperialKit(p);
  81. }
  82.  
  83. // Name of who clicked
  84. String clicked = e.getWhoClicked().getName();
  85. // ------------------
  86. if (e.getInventory().getName() != "§aKits") {
  87. return;
  88. }
  89.  
  90. if (e.getCurrentItem().getItemMeta().getDisplayName()
  91. .contains("§7Peasant")) {
  92. e.setCancelled(true);
  93. leatherGUI(p);
  94. }
  95. if (e.getCurrentItem().getItemMeta().getDisplayName()
  96. .contains("§3Knight")) {
  97. e.setCancelled(true);
  98. knightGUI(p);
  99. }
  100.  
  101. if (e.getCurrentItem().getItemMeta().getDisplayName()
  102. .contains("§cImperial")) {
  103. e.setCancelled(true);
  104. imperialGUI(p);
  105. }
  106.  
  107. if (e.getCurrentItem().getItemMeta().getDisplayName()
  108. .contains("§eEpic Kit")) {
  109. e.setCancelled(true);
  110. epicGUI(p);
  111. }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement