Added method to API to check whether a player is on the exclude-list

This commit is contained in:
Artemis-the-gr8 2023-02-25 14:32:36 +01:00
parent 18ac4ecf00
commit 18bf8a56a7
3 changed files with 19 additions and 4 deletions

View File

@ -107,7 +107,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>deploy</phase>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
@ -120,7 +120,7 @@
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
@ -133,7 +133,7 @@
<executions>
<execution>
<id>attach-javadocs</id>
<phase>deploy</phase>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>

View File

@ -4,6 +4,16 @@ import java.util.LinkedHashMap;
public interface StatManager {
/** Checks if the player belonging to this name
* is on PlayerStats' exclude-list (meaning this
* player is not counted for the server total, and
* does not show in top results).
*
* @param playerName the name of the player to check
* @return true if this player is on the exclude-list
*/
boolean isExcludedPlayer(String playerName);
/** Gets a RequestGenerator that can be used to create a PlayerStatRequest.
* This RequestGenerator will make sure all default settings
* for a player-statistic-lookup are configured.

View File

@ -25,7 +25,7 @@ import java.util.stream.Collectors;
/**
* Turns user input into a {@link StatRequest} that can be
* used to get statistic data.
* executed to get statistic data.
*/
public final class RequestManager implements StatManager {
@ -45,6 +45,11 @@ public final class RequestManager implements StatManager {
};
}
@Override
public boolean isExcludedPlayer(String playerName) {
return offlinePlayerHandler.isExcludedPlayer(playerName);
}
@Contract("_ -> new")
@Override
public @NotNull RequestGenerator<Integer> createPlayerStatRequest(String playerName) {