Created
March 26, 2015 21:51
-
-
Save tarunbod/f1690034c4c473fef1fb to your computer and use it in GitHub Desktop.
BungeeCordUtils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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