Extend the API with a ProxyServer type.

This commit is contained in:
Andrew Steinborn
2018-08-05 01:26:07 -04:00
parent 06a6493605
commit 22d1398f73
5 changed files with 85 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
package com.velocitypowered.api.proxy;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Optional;
import java.util.UUID;
/**
* Represents a Minecraft proxy server that follows the Velocity API.
*/
public interface ProxyServer {
/**
* Retrieves the player currently connected to this proxy by their Minecraft username.
* @param username the username
* @return an {@link Optional} with the player
*/
Optional<Player> getPlayer(@Nonnull String username);
/**
* Retrieves the player currently connected to this proxy by their Minecraft UUID.
* @param uuid the UUID
* @return an {@link Optional} with the player
*/
Optional<Player> getPlayer(@Nonnull UUID uuid);
/**
* Retrieves all players currently connected to this proxy. This call may or may not be a snapshot of all players
* online.
* @return the players online on this proxy
*/
Collection<Player> getAllPlayers();
}