Development Assistance Implementing bungee cord

Discussion in 'Plugin Help/Development/Requests' started by ProMCKingz, Nov 29, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ProMCKingz

    Hey,
    I was wondering how you would make bungee teleportation.
    So I am developing a "Server Selector" as part of my plugin, and was wondering how you could teleport between servers. Here is my ClickListener class for my GUI.
    Code:java
    1. @EventHandler
    2. public void onClick(InventoryClickEvent event) {
    3. HumanEntity entity = event.getWhoClicked();
    4. if ((entity instanceof Player)) {
    5. Player player = (Player) entity;
    6. if (event.getInventory().getName()
    7. .equals(Main.name().getName())) {
    8. event.setCancelled(true);
    9. ItemStack clicked = event.getCurrentItem();
    10. if (clicked != null) {
    11. if (clicked.getType() == Material.DIAMOND_SWORD) {
    12. player.closeInventory();
    13. player.performCommand("server KitPvP");
    14. //Ignore the perform commands
    15. player.performCommand("Ignore the perform commands for now");
    16. player.sendMessage(ChatColor.GREEN + "Teleported to KitPvP!");
    17. }
    18. else if (clicked.getType() == Material.GRASS){
    19. player.closeInventory();
    20. player.performCommand("/server ");
    21. player.sendMessage(ChatColor.GREEN + "Telported to Creative");
    22. }
    23. else if (clicked.getType() == Material.CHEST){
    24. player.closeInventory();
    25. player.performCommand("/bportals");
    26. player.sendMessage(ChatColor.GREEN + "Telported to Survival Games");
    27. }
    28. else if (clicked.getType() == Material.MOB_SPAWNER){
    29. player.closeInventory();
    30. player.performCommand("/bportals");
    31. player.sendMessage(ChatColor.GREEN + "Telported to Prison");
    32. }
    33. else if (clicked.getType() == Material.SNOW_BALL){
    34. player.closeInventory();
    35. player.performCommand("/bportals");
    36. player.sendMessage(ChatColor.GREEN + "Telported to Vanilla");
    37. }
    38. else if (clicked.getType() == Material.NETHER_STAR){
    39. player.closeInventory();
    40. player.sendMessage(ChatColor.RED + "Unkown Gamemode");
    41. player.sendMessage(ChatColor.AQUA + "Tell us at: [URL='http://www.minelegends.us']www.minelegends.us[/URL]");
    42. }
    43.  
    44. }
    45.  
    46. }
    47. }
    48. }
    49. }
    50.  

    Everything works, however I would like to know how I could add a server teleportation method.
    Thanks, ProMCKingz
     
  2. Offline

    PreFiXAUT

    Just search for a Tutorial or Google it. I found it within a Minute. Eventho allot of people don't seem to like him, he helped me out with it -> TheBCBros on YT, and he has a Tutorial for that too so.

    Another point -> Talking about BungeeCord is never a good Idea because no Admin/Moderator/Someone else "wants" to see any thing about BungeeCord on Bukkit. So if you have further troubles with it, consider to ask on BungeeCords Forum.
     
  3. Offline

    ProMCKingz

    PreFiXAUT
    How would you register it in a different class?

    PreFiXAUT
    Why don't bukkit like bungee? they created it...
     
  4. Thread moved to a more appropriate section, and merged posts. Please use the edit button rather than double posting.

    EDIT: ProMCKingz Bukkit did not create Bungee, Spigot (a fork of Bukkit) created Bungeecord. Spigot and Bukkit are very different, the main difference is that Spigot changed the proxy so that bungeecord works.
     
  5. Offline

    ProMCKingz

    bwfcwalshy
    Are you familiar with the bungee API?
     
  6. Offline

    PreFiXAUT

    You don't need to get Classes from BungeeCord. You need to use PluginMessages, which allows to communicate between Plugins with each other. When everything is setup you need to send Bytes with a Player and with this, it will send the Player to another Server. Just search for it.
     
  7. Offline

    ProMCKingz

    PreFiXAUT
    I have been searching for a long time. However I am still condused on using it with different classes. Do you need to register it like a normal API? Or not?
     
  8. Offline

    PreFiXAUT

    What the heck are you searching?? "Help I need infos about BungeeCord in Bukkit and a API and this isn't getting long enoght"??

     
Thread Status:
Not open for further replies.

Share This Page