Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.teliax.tutorial.commands;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.DyeColor;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Item;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import java.util.ArrayList;
- public class BuyGUI implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if (sender instanceof Player){
- Player player = (Player) sender;
- Inventory gui;
- gui = Bukkit.createInventory(player, 45, "§8[§5§lBUYCRAFT§8]");
- ItemStack hvidglas = new Item(Material.STAINED_GLASS_PANE, 1, DyeColor.WHITE.getData());
- ItemStack glas = new ItemStack(Material.STAINED_GLASS_PANE, 1, DyeColor.PURPLE.getData());
- ItemStack air = new ItemStack(Material.AIR);
- ItemStack rankbog = new ItemStack(Material.BOOK);
- ItemStack andetbog = new ItemStack(Material.BOOK);
- ItemMeta glas_meta = glas.getItemMeta();
- glas_meta.setDisplayName(ChatColor.RED + " ");
- ArrayList<String> glas_lore = new ArrayList<>();
- glas_lore.add(ChatColor.GOLD + " ");
- glas_meta.setLore(glas_lore);
- glas.setItemMeta(glas_meta);
- ItemMeta hvidglas_meta = hvidglas.getItemMeta();
- hvidglas_meta.setDisplayName(ChatColor.RED + " ");
- ArrayList<String> hvidglas_lore = new ArrayList<>();
- hvidglas_lore.add(ChatColor.GOLD + " ");
- hvidglas_meta.setLore(hvidglas_lore);
- hvidglas.setItemMeta(hvidglas_meta);
- ItemMeta bog_meta = rankbog.getItemMeta();
- bog_meta.setDisplayName("§5§lRANKS");
- ArrayList<String> bog_lore = new ArrayList<>();
- bog_lore.add("§fTryk her, for at tilgå §dranks§f.");
- bog_lore.add("");
- bog_lore.add("§fIndeholder:");
- bog_lore.add(" §8§m-§5§l OMEGA §f§lRANK");
- bog_lore.add(" §8§m-§e§l GAMMA §f§lRANK");
- bog_lore.add(" §8§m-§a§l ALPHA §f§lRANK");
- bog_lore.add(" §8§m-§b§l BETA §f§lRANK");
- bog_meta.setLore(bog_lore);
- rankbog.setItemMeta(bog_meta);
- ItemMeta andetbog_meta = andetbog.getItemMeta();
- andetbog_meta.setDisplayName("§9§lANDET");
- ArrayList<String> andetbog_lore = new ArrayList<>();
- andetbog_lore.add("§fTryk her, for at tilgå §3andet§f.");
- andetbog_lore.add("");
- andetbog_lore.add("§fIndeholder:");
- andetbog_lore.add(" §8§m-§b§l FLY §f§lKOMMANDO");
- andetbog_lore.add(" §8§m-§a§l PV §f§l10");
- andetbog_lore.add(" §8§m-§e§l RESET §f§lMINER");
- andetbog_meta.setLore(andetbog_lore);
- andetbog.setItemMeta(andetbog_meta);
- ItemStack[] menu_items = {glas, glas, glas, glas, glas, glas, glas, glas, glas, air, air, air, air, air, air, air, air, air, air, air, air, rankbog, air, andetbog, air, air, air, air, air, air, air, air, air, air, air, air, hvidglas, hvidglas, hvidglas, hvidglas, hvidglas, hvidglas, hvidglas, hvidglas, hvidglas};
- gui.setContents(menu_items);
- player.openInventory(gui);
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment