Skip to content

Instantly share code, notes, and snippets.

@TobiasGrether
Created March 20, 2020 16:56
Show Gist options
  • Select an option

  • Save TobiasGrether/c8e0aa8cecd445ec6a96c1c84087c0c5 to your computer and use it in GitHub Desktop.

Select an option

Save TobiasGrether/c8e0aa8cecd445ec6a96c1c84087c0c5 to your computer and use it in GitHub Desktop.
Adding Servers on Runtime for Waterdog
static void registerServer(String servername, String ip, int port) {
ServerInfo info = Main.getInstance().getProxy().constructServerInfo(servername, new InetSocketAddress(ip, port), servername, false, true, "bedrock");
Main.getInstance().getProxy().getServers().put(servername, info);
if (servername.startsWith("Lobby") || servername.startsWith("BetaLobby")) {
Main.lobbys.put(info.getName(), info);
Iterables.get(Main.getInstance().getProxy().getConfig().getListeners(), 0).getServerPriority().add(info.getName());
}
System.out.println("Registered Server " + servername);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment