mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-08 16:10:26 +00:00
fix javadocs again, add getServerFor in velocity
This commit is contained in:
@@ -56,11 +56,22 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<reportOutputDirectory>../javadoc</reportOutputDirectory>
|
||||
<destDir>${project.name}</destDir>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeDependencySources>true</includeDependencySources>
|
||||
<dependencySourceExcludes>
|
||||
<dependencySourceExclude>com.velocitypowered:*</dependencySourceExclude>
|
||||
</dependencySourceExcludes>
|
||||
<source>11</source>
|
||||
<destDir>../javadoc/${project.name}</destDir>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -131,6 +142,22 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.imaginarycode.minecraft</groupId>
|
||||
<artifactId>RedisBungee-API</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<classifier>javadoc</classifier>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.spongepowered</groupId>
|
||||
<artifactId>configurate-yaml</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.velocitypowered</groupId>
|
||||
<artifactId>velocity-api</artifactId>
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user