Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void STOP(PlayerInteractEvent e) {
- stop = Bukkit.createInventory(null, 9, ChatColor.DARK_RED + "" + ChatColor.UNDERLINE + "Are you sure?");
- stop.setItem(0, accept);
- stop.setItem(8, deny);
- stop.setItem(4, RUSHURE);
- }
- //-------------------------- Stop GUI ------------------------------------------------
- @SuppressWarnings("deprecation")
- @EventHandler
- public void STOP2(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- //------------------------------------------ accept stop -----------------------------------------------------
- if(e.getInventory().getName().equals(ChatColor.DARK_RED + "" + ChatColor.UNDERLINE + "Are you sure?")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.EMERALD_BLOCK) {
- p.performCommand("stop");
- p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_USE, 1.0f, 1.0f);
- p.closeInventory();
- p.getInventory().remove(accept);
- p.updateInventory();
- //------------------------------------------ accept stop -----------------------------------------------------
- }
- //------------------------------------------- deny stop ------------------------------------------------------
- if(e.getInventory().getName().equals(ChatColor.DARK_RED + "" + ChatColor.UNDERLINE + "Are you sure?")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.BARRIER) {
- p.openInventory(agui);
- p.playSound(p.getLocation(), Sound.ITEM_SHIELD_BREAK, 1.0f, 1.0f);
- }
- }
- //------------------------------------------- deny stop ------------------------------------------------------
- }
- }
- //-------------------------- Stop GUI ------------------------------------------------
- // ------------------------- Agui GUI -----------------------------
- @EventHandler
- public void Reload(PlayerInteractEvent e) {
- rload = Bukkit.createInventory(null, 9, ChatColor.RED + "" + ChatColor.UNDERLINE + "Are you sure?");
- rload.setItem(4, RUSHURE);
- rload.setItem(0, accept);
- rload.setItem(8, deny);
- }
- @SuppressWarnings("deprecation")
- @EventHandler
- public void Reload2(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- //-------------------------------- Reload ------------------------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.UNDERLINE + "Are you sure?")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.EMERALD_BLOCK) {
- p.performCommand("reload");
- p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0f, 1.0f);
- p.closeInventory();
- p.getInventory().remove(accept);
- p.updateInventory();
- }
- //-------------------------------- Reload ------------------------------------------------
- // ------------------------------- reload button ------------------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!")) {
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.PRISMARINE_SHARD) {
- }
- }
- // ------------------------------- reload button ------------------------------------------
- // ------------------------------- go back button -----------------------------------------
- if(e.getInventory().getName().equals(rload.getName())) {
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.BARRIER) {
- p.openInventory(agui);
- p.playSound(p.getLocation(), Sound.ITEM_SHIELD_BREAK, 1.0f, 1.0f);
- }
- }
- }
- }
- // ------------------------------- go back button -----------------------------------------
- @SuppressWarnings("deprecation")
- @EventHandler
- public void AGUI(PlayerInteractEvent e ) {
- Player p = e.getPlayer();
- // GUI! V---
- agui = Bukkit.createInventory(null, 54, ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!");
- agui.setItem(0, Plugins);
- agui.setItem(40, gm1);
- agui.setItem(37, gm0);
- agui.setItem(43, gm3);
- agui.setItem(45, reload);
- agui.setItem(53, STOP);
- if(p.hasPermission("hhf.agui.open")) {
- if(p.getInventory().getItemInHand().getType() == Material.END_CRYSTAL) {
- if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
- p.openInventory(agui);
- }
- }
- }
- // ------------------------- Agui GUI -----------------------------
- }
- //----------------------------- Execute Commands for Agui buttons -------------------------------------
- @EventHandler
- public void AGUI2(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- // --------------------------- Plugins button -----------------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.REDSTONE) {
- p.performCommand("plugins");
- p.closeInventory();
- p.playSound(p.getLocation(), Sound.ENTITY_ARMORSTAND_PLACE, 1.0f, 1.0f);
- }
- // --------------------------- Plugins button -----------------------------------------
- // ------------------------------- Gamemode 1 button -----------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!")) {
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.ELYTRA) {
- p.sendMessage(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Gamemode set to " + ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Gamemode 1!");
- p.setGameMode(GameMode.CREATIVE);
- p.closeInventory();
- p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_FLAP, 1.0f, 1.0f);
- }
- // ------------------------------- Gamemode 1 button -----------------------------------
- // ------------------------------- Gamemode 0 button --------------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.ENCHANTMENT_TABLE) {
- p.setGameMode(GameMode.SURVIVAL);
- p.sendMessage(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Gamemode set to " + ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Gamemode 0!");
- p.closeInventory();
- p.playSound(p.getLocation(), Sound.ENTITY_ITEMFRAME_PLACE, 1.0f, 1.0f);
- }
- }
- // ------------------------------- Gamemode 0 button --------------------------------------
- // ------------------------------- Gamemode 3 button --------------------------------------
- if(e.getInventory().getName().equals(ChatColor.RED + "" + ChatColor.BOLD + "Admin GUI!")) {
- e.setCancelled(true);
- if(e.getCurrentItem() == null) {
- return;
- }
- if(e.getCurrentItem().getType() == Material.ENDER_PORTAL_FRAME) {
- p.setGameMode(GameMode.SPECTATOR);
- p.sendMessage(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Gamemode set to " + ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Gamemode 3!");
- p.closeInventory();
- p.playSound(p.getLocation(), Sound.ENTITY_ITEMFRAME_BREAK, 1.0f, 1.0f);
- }
- }
- }
- }
- // ------------------------------- Gamemode 3 button --------------------------------------
- //----------------------------- Execute Commands for Agui buttons -------------------------------------
- }
- // ---------------------------------- reload and stop slots ------------------------------------------------------
- @EventHandler
- public void onClick(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- if(e.getInventory().getTitle().equals("agui"));
- if(e.getSlot() == 45) {
- p.openInventory(rload);
- p.playSound(p.getLocation(), Sound.ITEM_SHIELD_BLOCK, 1.0f, 1.0f);
- } else if (e.getSlot() == 53) {
- p.openInventory(stop);
- p.playSound(p.getLocation(), Sound.ITEM_BUCKET_EMPTY_LAVA, 1.0f, 1.0f);
- }
- }
- }
- // ---------------------------------- reload and stop slots ------------------------------------------------------
- // ------------------------- Agui GUI's -----------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement