Advertisement
Guest User

MiniGameSelection Main Menu

a guest
Dec 10th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. package me.linebeck.Tingle.gui;
  2.  
  3. import java.util.HashSet;
  4. import java.util.UUID;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.ChatColor;
  8. import org.bukkit.Material;
  9. import org.bukkit.enchantments.Enchantment;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.inventory.Inventory;
  12. import org.bukkit.inventory.ItemStack;
  13. import org.bukkit.inventory.meta.ItemMeta;
  14.  
  15. public class MiniGameSelection
  16. {
  17. public static HashSet<UUID> GuiUsers = new HashSet<UUID>();
  18.  
  19.  
  20. public static void openGui(Player player)
  21. {
  22. Inventory gui = Bukkit.createInventory(null, 27, ChatColor.GOLD + "" + ChatColor.BOLD + "Mini" + ChatColor.GREEN + "" + ChatColor.BOLD + "Games");
  23.  
  24. ItemStack phantomChase = new ItemStack(Material.PURPLE_SHULKER_BOX);
  25. ItemMeta phantomChaseMeta = phantomChase.getItemMeta();
  26. phantomChaseMeta.setDisplayName(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Phantom" + ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Chase");
  27. phantomChase.setItemMeta(phantomChaseMeta);
  28.  
  29. ItemStack cuccoBattle = new ItemStack(Material.COOKED_CHICKEN);
  30. ItemMeta cuccoBattleMeta = cuccoBattle.getItemMeta();
  31. cuccoBattleMeta.setDisplayName(ChatColor.WHITE + "" + ChatColor.BOLD + "Cucco" + ChatColor.DARK_RED + "" + ChatColor.BOLD + "Battle");
  32. cuccoBattle.setItemMeta(cuccoBattleMeta);
  33.  
  34. ItemStack zeldaFest = new ItemStack(Material.ENCHANTING_TABLE);
  35. ItemMeta zeldaFestMeta = zeldaFest.getItemMeta();
  36. zeldaFestMeta.setDisplayName(ChatColor.RED + "" + ChatColor.BOLD + "Zelda" + ChatColor.BLUE + ChatColor.BOLD + "Fest");
  37. zeldaFest.setItemMeta(zeldaFestMeta);
  38.  
  39. ItemStack close = new ItemStack(Material.BARRIER);
  40. ItemMeta closeMeta = close.getItemMeta();
  41. closeMeta.setDisplayName(ChatColor.RED + "" + ChatColor.BOLD + "Close");
  42. close.setItemMeta(closeMeta);
  43.  
  44. gui.setItem(12, phantomChase);
  45. gui.setItem(13, cuccoBattle);
  46. gui.setItem(14, zeldaFest);
  47. gui.setItem(22, close);
  48.  
  49. //Glass Panes
  50. ItemStack glassPane = new ItemStack(Material.BLUE_STAINED_GLASS_PANE);
  51. ItemMeta glassPaneMeta = glassPane.getItemMeta();
  52.  
  53. //Glass Panes Meta
  54. glassPaneMeta.setDisplayName(" ");
  55. glassPaneMeta.addEnchant(Enchantment.DURABILITY, 3, true);
  56. glassPane.setItemMeta(glassPaneMeta);
  57.  
  58. for(int i = 0; i < gui.getSize(); i++)
  59. {
  60. if(gui.getItem(i) == null)
  61. {
  62. gui.setItem(i, glassPane);
  63. }
  64. }
  65.  
  66. player.openInventory(gui);
  67. GuiUsers.add(player.getUniqueId());
  68.  
  69. player.sendMessage("HELLO?");
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement