Advertisement
DSHunterMC

Untitled

Nov 26th, 2017
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. @SuppressWarnings({ "unlikely-arg-type" })
  2. @EventHandler
  3. public void AGUI(PlayerInteractEvent e) {
  4. Player p = e.getPlayer();
  5.  
  6. agui = Bukkit.createInventory(p, 54, ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "" + ChatColor.ITALIC + "Admin" +
  7. ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "" + ChatColor.ITALIC + "GUI");
  8.  
  9. agui.setItem(45, ReloadButton);
  10.  
  11. if(p.hasPermission("hhf.agui.open")) {
  12. final ItemStack AguiI = p.getInventory().getItemInMainHand();
  13. if(AguiI != null && AguiI.equals(Material.END_CRYSTAL)) {
  14. if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  15. p.openInventory(agui);
  16. }else {
  17. if(!p.hasPermission("hhf.agui.open")) {
  18. p.sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + "HHF" + ChatColor.RED + " - I'm sorry, but it seems you do not have permission to use this Item. Please contact the server admin to check if this is an error!");
  19.  
  20. }
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement