Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onClick(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- try {
- if(e.getInventory().getName().equalsIgnoreCase("§l§bLobby Changer")) {
- e.setCancelled(true);
- double x = p.getLocation().getX();
- double y = p.getLocation().getY();
- double z = p.getLocation().getZ();
- float yaw = p.getLocation().getYaw();
- float pitch = p.getLocation().getPitch();
- if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§8Lobby1")) {
- Location loc = new Location(Bukkit.getWorld(Main.world1), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aLobby1§7!");
- return;
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§8Lobby2")) {
- Location loc = new Location(Bukkit.getWorld(Main.world2), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aLobby2§7!");
- return;
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§8Lobby3")) {
- Location loc = new Location(Bukkit.getWorld(Main.world3), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aLobby3§7!");
- return;
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§8Lobby4")) {
- Location loc = new Location(Bukkit.getWorld(Main.world4), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aLobby4§7!");
- return;
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§8Lobby5")) {
- Location loc = new Location(Bukkit.getWorld(Main.world5), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aLobby5§7!");
- return;
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§6Premium Lobby1")) {
- if(p.hasPermission("lobby.lobby.premium")) {
- Location loc = new Location(Bukkit.getWorld(Main.pworld1), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aPremium Lobby1§7!");
- return;
- }else {
- p.sendMessage(Main.np);
- }
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§6Premium Lobby2")) {
- if(p.hasPermission("lobby.lobby.premium")) {
- Location loc = new Location(Bukkit.getWorld(Main.pworld2), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aPremium Lobby2§7!");
- return;
- }else {
- p.sendMessage(Main.np);
- }
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§6Premium Lobby3")) {
- if(p.hasPermission("lobby.lobby.premium")) {
- Location loc = new Location(Bukkit.getWorld(Main.pworld3), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §aPremium Lobby3§7!");
- return;
- }else {
- p.sendMessage(Main.np);
- }
- }else if(e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cAdmin Lobby")) {
- if(p.hasPermission("lobby.lobby.vip")) {
- Location loc = new Location(Bukkit.getWorld(Main.vworld1), x, y, z, yaw, pitch);
- p.teleport(loc);
- p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 2F, 1F);
- p.closeInventory();
- p.sendMessage(Main.pr + "§7Du bist nun in der §cAdmin Lobby§7!");
- return;
- }else {
- p.sendMessage(Main.np);
- }
- }
- }
- } catch (NullPointerException e1) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement