Guest User

Untitled

a guest
Apr 29th, 2022
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. package me.advex.gui.armorstand.Gui;
  2.  
  3. import me.advex.gui.armorstand.Gui.commands.ArmourStandCommand;
  4. import me.advex.gui.armorstand.Gui.events.MenuHandler;
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.Material;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.inventory.Inventory;
  10. import org.bukkit.inventory.ItemStack;
  11. import org.bukkit.inventory.meta.ItemMeta;
  12. import org.bukkit.plugin.java.JavaPlugin;
  13.  
  14. import java.util.ArrayList;
  15.  
  16. public final class ArmorStandGui extends JavaPlugin {
  17.  
  18. @Override
  19. public void onEnable() {
  20. // Plugin startup logic
  21. System.out.println("Plugin Has started up.");
  22.  
  23. getCommand("armorstand").setExecutor(new ArmourStandCommand(this));
  24. getServer().getPluginManager().registerEvents(new MenuHandler(), this);
  25.  
  26. }
  27. public void OpenMainMenu (Player player){
  28. Inventory main_menu = Bukkit.createInventory(player, 9, ChatColor.GOLD + "" + ChatColor.BOLD + "Armour Stand Editor");
  29.  
  30. //Options for menu
  31.  
  32. ItemStack armorstand = new ItemStack(Material.ARMOR_STAND);
  33. ItemMeta armorstand_meta = armorstand.getItemMeta();
  34. armorstand_meta.setDisplayName(ChatColor.GREEN + "Create");
  35. ArrayList<String> armorstand_lore = new ArrayList<>();
  36. armorstand_lore.add(ChatColor.GRAY + "Create a new armor stand.");
  37. armorstand_meta.setLore(armorstand_lore);
  38. armorstand.setItemMeta(armorstand_meta);
  39.  
  40. ItemStack close = new ItemStack(Material.BARRIER);
  41. ItemMeta close_meta = close.getItemMeta();
  42. close_meta.setDisplayName(ChatColor.RED + "Close");
  43. close.setItemMeta(close_meta);
  44.  
  45. main_menu.setItem(0, armorstand);
  46. main_menu.setItem(8, close);
  47. player.openInventory(main_menu);
  48. }
  49. public void openArmourStandMenu(Player player){
  50. Inventory armourstandedit_menu = Bukkit.createInventory(player, 9, ChatColor. GOLD + "" + ChatColor.BOLD + "Armour Stand Editor");
  51.  
  52. ItemStack arms = new ItemStack(Material.ARMOR_STAND);
  53. ItemStack glow = new ItemStack(Material.SEA_LANTERN);
  54. ItemStack armour = new ItemStack(Material.LEATHER_CHESTPLATE);
  55. ItemStack base = new ItemStack(Material.STONE_PRESSURE_PLATE);
  56. ItemStack complete = new ItemStack(Material.GREEN_CONCRETE);
  57. ItemStack delete = new ItemStack(Material.RED_CONCRETE);
  58.  
  59. ItemMeta arms_meta = arms.getItemMeta();
  60. arms_meta.setDisplayName(ChatColor.GREEN + "Arms");
  61. ArrayList<String> arms_lore = new ArrayList<>();
  62. arms_lore.add(ChatColor.GRAY + "Add or Remove");
  63. arms_lore.add(ChatColor.GRAY + "Arms from the Armour Stand");
  64. arms_meta.setLore(arms_lore);
  65. arms.setItemMeta(arms_meta);
  66.  
  67. ItemMeta glow_Meta = glow.getItemMeta();
  68. glow_Meta.setDisplayName(ChatColor.WHITE + "Add Glow");
  69. glow.setItemMeta(glow_Meta);
  70.  
  71. ItemMeta armour_meta = armour.getItemMeta();
  72. armour_meta.setDisplayName(ChatColor.BLUE + "Set Armour");
  73. armour.setItemMeta(armour_meta);
  74.  
  75. ItemMeta base_meta = base.getItemMeta();
  76. base_meta.setDisplayName(ChatColor.DARK_GRAY + "Add a base");
  77. base.setItemMeta(base_meta);
  78.  
  79. ItemMeta complete_meta = complete.getItemMeta();
  80. complete_meta.setDisplayName(ChatColor.GREEN + "Confirm Creation");
  81. complete.setItemMeta(complete_meta);
  82.  
  83. ItemMeta delete_meta = delete.getItemMeta();
  84. delete_meta.setDisplayName(ChatColor.DARK_RED + "Cancel Creation");
  85. delete.setItemMeta(delete_meta);
  86.  
  87.  
  88.  
  89. armourstandedit_menu.setItem(0, arms);
  90. armourstandedit_menu.setItem(1, glow);
  91. armourstandedit_menu.setItem(2, armour);
  92. armourstandedit_menu.setItem(3, base);
  93. armourstandedit_menu.setItem(7, complete );
  94. armourstandedit_menu.setItem(8, delete);
  95.  
  96. player.openInventory(armourstandedit_menu);
  97.  
  98. }
  99.  
  100. }
  101.  
  102.  
  103.  
  104.  
  105.  
Advertisement
Add Comment
Please, Sign In to add comment