Advertisement
JulianGames

Gadgets

Jan 21st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.63 KB | None | 0 0
  1. package de.HypeLobby.items;
  2.  
  3. import de.HypeLobby.*;
  4. import org.bukkit.plugin.*;
  5. import org.bukkit.event.player.*;
  6. import org.bukkit.event.block.*;
  7. import de.HypeLobby.api.*;
  8. import org.bukkit.*;
  9. import org.bukkit.entity.*;
  10. import org.bukkit.inventory.*;
  11. import org.bukkit.event.*;
  12. import org.bukkit.event.inventory.*;
  13. import org.bukkit.inventory.meta.ItemMeta;
  14. import org.bukkit.inventory.meta.SkullMeta;
  15.  
  16. public class Gadgets implements Listener
  17. {
  18. private Main plugin;
  19.  
  20. public Gadgets(final Main plugin) {
  21. this.plugin = plugin;
  22. plugin.getServer().getPluginManager().registerEvents((Listener)this, (Plugin)plugin);
  23. }
  24.  
  25. @EventHandler
  26. public void on(final PlayerInteractEvent e) {
  27. final Player p = e.getPlayer();
  28. if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) {
  29. return;
  30. }
  31. try {
  32. if (e.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§aGadgets §7<Rechtsklick>")) {
  33. final Inventory inv = Bukkit.createInventory((InventoryHolder)null, 45, "§aGadgets");
  34. final ItemStack kopf = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
  35. final SkullMeta kopfmeta = (SkullMeta)kopf.getItemMeta();
  36. kopfmeta.setOwner(p.getName());
  37. kopfmeta.setDisplayName("§eEmojiis");
  38. kopf.setItemMeta((ItemMeta)kopfmeta);
  39. inv.setItem(0, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  40. inv.setItem(1, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  41. inv.setItem(2, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  42. inv.setItem(3, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  43. inv.setItem(4, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  44. inv.setItem(5, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  45. inv.setItem(6, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  46. inv.setItem(7, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  47. inv.setItem(8, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  48. inv.setItem(9, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  49. inv.setItem(10, ItemAPI.createItem(Material.FLINT_AND_STEEL, 0, "§6JetPack"));
  50. inv.setItem(11, ItemAPI.createItem(Material.MAGMA_CREAM, 0, "§cTrails"));
  51. inv.setItem(12, kopf);
  52. inv.setItem(13, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
  53. inv.setItem(14, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
  54. inv.setItem(15, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
  55. inv.setItem(16, ItemAPI.createItem(Material.BARRIER, 0, "§c§nCOMING SOON"));
  56. inv.setItem(17, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  57. inv.setItem(18, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  58. inv.setItem(19, ItemAPI.createItem(Material.STAINED_CLAY, 14, "§6Roter Ballon"));
  59. inv.setItem(20, ItemAPI.createItem(Material.STAINED_CLAY, 11, "§6Blauer Ballon"));
  60. inv.setItem(21, ItemAPI.createItem(Material.STAINED_CLAY, 13, "§6Gr\u00dcner Ballon"));
  61. inv.setItem(22, ItemAPI.createItem(Material.STAINED_CLAY, 4, "§6Gelber Ballon"));
  62. inv.setItem(23, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  63. inv.setItem(24, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  64. inv.setItem(25, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  65. inv.setItem(26, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  66. inv.setItem(27, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  67. inv.setItem(28, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  68. inv.setItem(29, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  69. inv.setItem(30, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  70. inv.setItem(31, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  71. inv.setItem(32, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  72. inv.setItem(33, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  73. inv.setItem(34, ItemAPI.createItem(Material.IRON_FENCE, 0, "§c§nCOMING SOON"));
  74. inv.setItem(35, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  75. inv.setItem(36, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  76. inv.setItem(37, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  77. inv.setItem(38, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  78. inv.setItem(39, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  79. inv.setItem(40, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  80. inv.setItem(41, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  81. inv.setItem(42, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  82. inv.setItem(43, ItemAPI.createItem(Material.STAINED_GLASS_PANE, 7, " "));
  83. inv.setItem(44, ItemAPI.createItem(Material.BARRIER, 7, "§cBallon Entfernen"));
  84. p.openInventory(inv);
  85. p.playSound(p.getLocation(), Sound.LEVEL_UP, 15.0f, 15.0f);
  86. }
  87. }
  88. catch (Exception ex) {}
  89. }
  90.  
  91. @EventHandler
  92. public void on(final InventoryClickEvent e) {
  93. final Player p = (Player)e.getWhoClicked();
  94. if (e.getInventory().getName().equalsIgnoreCase("§aGadgets")) {
  95. try {
  96. if (e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§6JetPack")) {
  97. p.sendMessage("§7In Arbeit!");
  98. p.closeInventory();
  99. }
  100. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cTrails")) {
  101. p.performCommand("trails");
  102. }
  103. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Roter Ballon")) {
  104. p.performCommand("balloon rot");
  105. p.closeInventory();
  106. }
  107. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Blauer Ballon")) {
  108. p.performCommand("balloon blau");
  109. p.closeInventory();
  110. }
  111. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Gr\u00dcner Ballon")) {
  112. p.performCommand("balloon gruen");
  113. p.closeInventory();
  114. }
  115. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Gelber Ballon")) {
  116. p.performCommand("balloon gelb");
  117. p.closeInventory();
  118. }
  119. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§eEmojiis")) {
  120. p.performCommand("emojii");
  121. }
  122. else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cBallon Entfernen")) {
  123. p.performCommand("balloon disable");
  124. p.closeInventory();
  125. }
  126. }
  127. catch (Exception ex) {}
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement