Implement a connect callback - see #760
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.md_5.bungee.api.connection;
|
||||
|
||||
import net.md_5.bungee.api.Callback;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.tab.TabListHandler;
|
||||
@@ -35,6 +36,18 @@ public interface ProxiedPlayer extends Connection, CommandSender
|
||||
*/
|
||||
void connect(ServerInfo target);
|
||||
|
||||
/**
|
||||
* Connects / transfers this user to the specified connection, gracefully
|
||||
* closing the current one. Depending on the implementation, this method
|
||||
* might return before the user has been connected.
|
||||
*
|
||||
* @param target the new server to connect to
|
||||
* @param callback the method called when the connection is complete, or
|
||||
* when an exception is encountered. The boolean parameter denotes success
|
||||
* or failure.
|
||||
*/
|
||||
void connect(ServerInfo target, Callback<Boolean> callback);
|
||||
|
||||
/**
|
||||
* Gets the server this player is connected to.
|
||||
*
|
||||
|
Reference in New Issue
Block a user