Skip to content

Instantly share code, notes, and snippets.

@tarunbod
Created March 26, 2015 21:51
Show Gist options
  • Save tarunbod/f1690034c4c473fef1fb to your computer and use it in GitHub Desktop.
Save tarunbod/f1690034c4c473fef1fb to your computer and use it in GitHub Desktop.
BungeeCordUtils
public class BungeeUtils {
public static void connectPlayer(Plugin plugin, Player p, String server) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(server);
p.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
}
public static void connectAll(Plugin plugin, String server) {
Bukkit.getOnlinePlayers().forEach(p -> connectPlayer(plugin, p, server));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment