Advertisement
DSHunterMC

Untitled

Nov 26th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. @EventHandler
  2. public void AGUI(PlayerInteractEvent e) {
  3. Player p = e.getPlayer();
  4.  
  5. agui = Bukkit.createInventory(null, 54, ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "" + ChatColor.ITALIC + "Admin" +
  6. ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "" + ChatColor.ITALIC + "GUI");
  7.  
  8. agui.setItem(45, ReloadButton);
  9.  
  10.  
  11. if(p.hasPermission("hhf.agui.open")) {
  12. if(p.getInventory().getItemInMainHand().getType() == Material.END_CRYSTAL) {
  13. if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  14. p.openInventory(agui);
  15.  
  16. }
  17. }
  18. }
  19. }
  20.  
  21.  
  22. @EventHandler
  23. public void AGUI2(InventoryClickEvent e) {
  24. Player p = (Player) e.getWhoClicked();
  25.  
  26. if(e.getInventory().getName().equals(agui.getName())) {
  27. e.setCancelled(true);
  28. }
  29.  
  30. if(e.getCurrentItem() == null) {
  31. return;
  32. }
  33.  
  34. if(e.getSlot() == 45) {
  35. p.performCommand("plugins");
  36. }
  37.  
  38. }
  39.  
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement