Introduce ServerConnection interface

This will become very useful for plugin messaging support.
This commit is contained in:
Andrew Steinborn
2018-08-21 21:51:31 -04:00
parent 9c4e43e1b0
commit 2d0c826ec9
6 changed files with 58 additions and 43 deletions

View File

@@ -29,7 +29,7 @@ public interface Player extends CommandSource, InboundConnection {
* Returns the server that the player is currently connected to.
* @return an {@link Optional} the server that the player is connected to, which may be empty
*/
Optional<ServerInfo> getCurrentServer();
Optional<ServerConnection> getCurrentServer();
/**
* Sends a chat message to the player's client.

View File

@@ -0,0 +1,12 @@
package com.velocitypowered.api.proxy;
import com.velocitypowered.api.server.ServerInfo;
/**
* Represents a connection to a backend server from the proxy for a client.
*/
public interface ServerConnection {
ServerInfo getServerInfo();
Player getPlayer();
}