mirror of
https://github.com/PaperMC/Velocity.git
synced 2025-04-12 16:50:31 +08:00
Add disconnect API call
This commit is contained in:
parent
db9f668290
commit
8352f7fa70
@ -53,4 +53,6 @@ public interface Player extends CommandSource, InboundConnection, ChannelMessage
|
||||
* @return a new connection request
|
||||
*/
|
||||
ConnectionRequestBuilder createConnectionRequest(@NonNull ServerInfo info);
|
||||
|
||||
void disconnect(Component reason);
|
||||
}
|
||||
|
@ -134,6 +134,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
return new ConnectionRequestBuilderImpl(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect(Component reason) {
|
||||
connection.closeWith(Disconnect.create(reason));
|
||||
}
|
||||
|
||||
public VelocityServerConnection getConnectedServer() {
|
||||
return connectedServer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user