Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.advex.gui.armorstand.Gui;
- import me.advex.gui.armorstand.Gui.commands.ArmourStandCommand;
- import me.advex.gui.armorstand.Gui.events.MenuHandler;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- import java.util.ArrayList;
- public final class ArmorStandGui extends JavaPlugin {
- @Override
- public void onEnable() {
- // Plugin startup logic
- System.out.println("Plugin Has started up.");
- getCommand("armorstand").setExecutor(new ArmourStandCommand(this));
- getServer().getPluginManager().registerEvents(new MenuHandler(), this);
- }
- public void OpenMainMenu (Player player){
- Inventory main_menu = Bukkit.createInventory(player, 9, ChatColor.GOLD + "" + ChatColor.BOLD + "Armour Stand Editor");
- //Options for menu
- ItemStack armorstand = new ItemStack(Material.ARMOR_STAND);
- ItemMeta armorstand_meta = armorstand.getItemMeta();
- armorstand_meta.setDisplayName(ChatColor.GREEN + "Create");
- ArrayList<String> armorstand_lore = new ArrayList<>();
- armorstand_lore.add(ChatColor.GRAY + "Create a new armor stand.");
- armorstand_meta.setLore(armorstand_lore);
- armorstand.setItemMeta(armorstand_meta);
- ItemStack close = new ItemStack(Material.BARRIER);
- ItemMeta close_meta = close.getItemMeta();
- close_meta.setDisplayName(ChatColor.RED + "Close");
- close.setItemMeta(close_meta);
- main_menu.setItem(0, armorstand);
- main_menu.setItem(8, close);
- player.openInventory(main_menu);
- }
- public void openArmourStandMenu(Player player){
- Inventory armourstandedit_menu = Bukkit.createInventory(player, 9, ChatColor. GOLD + "" + ChatColor.BOLD + "Armour Stand Editor");
- ItemStack arms = new ItemStack(Material.ARMOR_STAND);
- ItemStack glow = new ItemStack(Material.SEA_LANTERN);
- ItemStack armour = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemStack base = new ItemStack(Material.STONE_PRESSURE_PLATE);
- ItemStack complete = new ItemStack(Material.GREEN_CONCRETE);
- ItemStack delete = new ItemStack(Material.RED_CONCRETE);
- ItemMeta arms_meta = arms.getItemMeta();
- arms_meta.setDisplayName(ChatColor.GREEN + "Arms");
- ArrayList<String> arms_lore = new ArrayList<>();
- arms_lore.add(ChatColor.GRAY + "Add or Remove");
- arms_lore.add(ChatColor.GRAY + "Arms from the Armour Stand");
- arms_meta.setLore(arms_lore);
- arms.setItemMeta(arms_meta);
- ItemMeta glow_Meta = glow.getItemMeta();
- glow_Meta.setDisplayName(ChatColor.WHITE + "Add Glow");
- glow.setItemMeta(glow_Meta);
- ItemMeta armour_meta = armour.getItemMeta();
- armour_meta.setDisplayName(ChatColor.BLUE + "Set Armour");
- armour.setItemMeta(armour_meta);
- ItemMeta base_meta = base.getItemMeta();
- base_meta.setDisplayName(ChatColor.DARK_GRAY + "Add a base");
- base.setItemMeta(base_meta);
- ItemMeta complete_meta = complete.getItemMeta();
- complete_meta.setDisplayName(ChatColor.GREEN + "Confirm Creation");
- complete.setItemMeta(complete_meta);
- ItemMeta delete_meta = delete.getItemMeta();
- delete_meta.setDisplayName(ChatColor.DARK_RED + "Cancel Creation");
- delete.setItemMeta(delete_meta);
- armourstandedit_menu.setItem(0, arms);
- armourstandedit_menu.setItem(1, glow);
- armourstandedit_menu.setItem(2, armour);
- armourstandedit_menu.setItem(3, base);
- armourstandedit_menu.setItem(7, complete );
- armourstandedit_menu.setItem(8, delete);
- player.openInventory(armourstandedit_menu);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment