2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-04-18 20:40:26 +00:00

fix javadocs again, add getServerFor in velocity

This commit is contained in:
2022-07-27 19:04:19 +04:00
parent 17897bc112
commit fdd537b276
5 changed files with 117 additions and 26 deletions

View File

@@ -1,6 +1,11 @@
package com.imaginarycode.minecraft.redisbungee;
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.server.ServerInfo;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
* This platform class exposes some internal RedisBungee functions. You obtain an instance of this object by invoking {@link RedisBungeeAPI#getRedisBungeeApi()}
@@ -18,6 +23,18 @@ public class RedisBungeeAPI extends AbstractRedisBungeeAPI {
redisBungeeApi = this;
}
/**
* Get the server where the specified player is playing. This function also deals with the case of local players
* as well, and will return local information on them.
*
* @param player a player uuid
* @return {@link ServerInfo} Can be null if proxy can't find it.
* @see #getServerNameFor(UUID)
*/
public final ServerInfo getServerFor(@NonNull UUID player) {
return ((RedisBungeeVelocityPlugin) this.plugin).getProxy().getServer(this.getServerNameFor(player)).map((RegisteredServer::getServerInfo)).orElse(null);
}
/**
* Api instance
*