Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.HypeLobby.items;
- import de.HypeLobby.*;
- import org.bukkit.plugin.*;
- import org.bukkit.event.player.*;
- import org.bukkit.event.block.*;
- import de.HypeLobby.api.*;
- import org.bukkit.*;
- import org.bukkit.entity.*;
- import org.bukkit.inventory.*;
- import org.bukkit.event.*;
- import org.bukkit.event.inventory.*;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.inventory.meta.SkullMeta;
- public class Gadgets implements Listener
- {
- private Main plugin;
- public Gadgets(final Main plugin) {
- this.plugin = plugin;
- plugin.getServer().getPluginManager().registerEvents((Listener)this, (Plugin)plugin);
- }
- @EventHandler
- public void on(final PlayerInteractEvent e) {
- final Player p = e.getPlayer();
- if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) {
- return;
- }
- try {
- if (e.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§aGadgets §7<Rechtsklick>")) {
- final Inventory inv = Bukkit.createInventory((InventoryHolder)null, 45, "§aGadgets");
- final ItemStack kopf = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
- final SkullMeta kopfmeta = (SkullMeta)kopf.getItemMeta();
- kopfmeta.setOwner(p.getName());
- kopfmeta.setDisplayName("§eEmojiis");
- kopf.setItemMeta((ItemMeta)kopfmeta);
- inv.setItem(0, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(1, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(2, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(3, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(4, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(5, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(6, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(7, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(8, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(9, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(10, ItemAPI.createItem(Material.FLINT_AND_STEEL, 0, "§6JetPack"));
- inv.setItem(11, ItemAPI.createItem(Material.MAGMA_CREAM, 0, "§cTrails"));
- inv.setItem(12, kopf);
- inv.setItem(13, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
- inv.setItem(14, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
- inv.setItem(15, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
- inv.setItem(16, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
- inv.setItem(17, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(18, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(19, ItemAPI.createItem(Material.STAINED_CLAY, 14, "§6Roter Ballon"));
- inv.setItem(20, ItemAPI.createItem(Material.STAINED_CLAY, 11, "§6Blauer Ballon"));
- inv.setItem(21, ItemAPI.createItem(Material.STAINED_CLAY, 13, "§6Gr\u00dcner Ballon"));
- inv.setItem(22, ItemAPI.createItem(Material.STAINED_CLAY, 4, "§6Gelber Ballon"));
- inv.setItem(23, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(24, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(25, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(26, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(27, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(28, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(29, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(30, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(31, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(32, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(33, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(34, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
- inv.setItem(35, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(36, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(37, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(38, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(39, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(40, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(41, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(42, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(43, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
- inv.setItem(44, ItemAPI.createItem(Material.BARRIER, 7, "§cBallon Entfernen"));
- p.openInventory(inv);
- p.playSound(p.getLocation(), Sound.LEVEL_UP, 15.0f, 15.0f);
- }
- }
- catch (Exception ex) {}
- }
- @EventHandler
- public void on(final InventoryClickEvent e) {
- final Player p = (Player)e.getWhoClicked();
- if (e.getInventory().getName().equalsIgnoreCase("§aGadgets")) {
- try {
- if (e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§6JetPack")) {
- p.sendMessage("§7In Arbeit!");
- p.closeInventory();
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cTrails")) {
- p.performCommand("trails");
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Roter Ballon")) {
- p.performCommand("balloon rot");
- p.closeInventory();
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Blauer Ballon")) {
- p.performCommand("balloon blau");
- p.closeInventory();
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Gr\u00dcner Ballon")) {
- p.performCommand("balloon gruen");
- p.closeInventory();
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Gelber Ballon")) {
- p.performCommand("balloon gelb");
- p.closeInventory();
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§eEmojiis")) {
- p.performCommand("emojii");
- }
- else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cBallon Entfernen")) {
- p.performCommand("balloon disable");
- p.closeInventory();
- }
- }
- catch (Exception ex) {}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement