Klasse StaffStatisticsAPI
This API provides methods to access statistics about punishments a user has given as a staff member, including bans, mutes, warns, kicks, and notes written.
Database Compatibility: All methods in this API are fully compatible with H2, SQLite, MySQL, and MariaDB databases. The API automatically adapts to the configured database type from the configuration file.
Example usage:
ZenithAPI api = ZenithAPI.getInstance();
if (api != null) {
StaffStatisticsAPI staffStats = api.getStatisticsAPI().getStaffStatistics();
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
// Get total punishments given
staffStats.getPunishmentsGiven(uuid).thenAccept(count -> {
getLogger().info("Staff member has given " + count + " punishments");
});
// Get bans given
staffStats.getBansGiven(uuid).thenAccept(count -> {
getLogger().info("Staff member has given " + count + " bans");
});
}
- Seit:
- 1.2.3
- Autor:
- Zenith-Studios
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungStaffStatisticsAPI(@NotNull me.kzlyth.ZenithMod plugin, @NotNull ZenithAPI api) Constructs a new StaffStatisticsAPI instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@NotNull CompletableFuture<Integer> getBansGiven(@NotNull String playerName) Gets the number of bans a user has given as a staff member.@NotNull CompletableFuture<Integer> getBansGiven(@NotNull UUID uuid) Gets the number of bans a user has given as a staff member.@NotNull CompletableFuture<Integer> getKicksGiven(@NotNull String playerName) Gets the number of kicks a user has given as a staff member.@NotNull CompletableFuture<Integer> getKicksGiven(@NotNull UUID uuid) Gets the number of kicks a user has given as a staff member.@NotNull CompletableFuture<Integer> getMutesGiven(@NotNull String playerName) Gets the number of mutes a user has given as a staff member.@NotNull CompletableFuture<Integer> getMutesGiven(@NotNull UUID uuid) Gets the number of mutes a user has given as a staff member.@NotNull CompletableFuture<Integer> getNotesGiven(@NotNull String playerName) Gets the number of notes a user has written as a staff member.@NotNull CompletableFuture<Integer> getNotesGiven(@NotNull UUID uuid) Gets the number of notes a user has written as a staff member.@NotNull CompletableFuture<Integer> getPunishmentsGiven(@NotNull String playerName) Gets the total number of punishments a user has given as a staff member.@NotNull CompletableFuture<Integer> getPunishmentsGiven(@NotNull UUID uuid) Gets the total number of punishments a user has given as a staff member.@NotNull CompletableFuture<Integer> getWarnsGiven(@NotNull String playerName) Gets the number of warns a user has given as a staff member.@NotNull CompletableFuture<Integer> getWarnsGiven(@NotNull UUID uuid) Gets the number of warns a user has given as a staff member.
-
Konstruktordetails
-
StaffStatisticsAPI
public StaffStatisticsAPI(@NotNull @NotNull me.kzlyth.ZenithMod plugin, @NotNull @NotNull ZenithAPI api) Constructs a new StaffStatisticsAPI instance.- Parameter:
plugin- The plugin instanceapi- The main API instance
-
-
Methodendetails
-
getPunishmentsGiven
@NotNull public @NotNull CompletableFuture<Integer> getPunishmentsGiven(@NotNull @NotNull UUID uuid) Gets the total number of punishments a user has given as a staff member.This counts all punishment types that the user has issued to other players.
Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getPunishmentsGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has given " + count + " punishments"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the total number of punishments given
-
getPunishmentsGiven
@NotNull public @NotNull CompletableFuture<Integer> getPunishmentsGiven(@NotNull @NotNull String playerName) Gets the total number of punishments a user has given as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getPunishmentsGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has given " + count + " punishments"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the total number of punishments given, or 0 if the player doesn't exist
-
getBansGiven
Gets the number of bans a user has given as a staff member.Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getBansGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has given " + count + " bans"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of bans given
-
getBansGiven
@NotNull public @NotNull CompletableFuture<Integer> getBansGiven(@NotNull @NotNull String playerName) Gets the number of bans a user has given as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getBansGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has given " + count + " bans"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of bans given, or 0 if the player doesn't exist
-
getMutesGiven
Gets the number of mutes a user has given as a staff member.Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getMutesGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has given " + count + " mutes"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of mutes given
-
getMutesGiven
@NotNull public @NotNull CompletableFuture<Integer> getMutesGiven(@NotNull @NotNull String playerName) Gets the number of mutes a user has given as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getMutesGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has given " + count + " mutes"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of mutes given, or 0 if the player doesn't exist
-
getWarnsGiven
Gets the number of warns a user has given as a staff member.Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getWarnsGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has given " + count + " warns"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of warns given
-
getWarnsGiven
@NotNull public @NotNull CompletableFuture<Integer> getWarnsGiven(@NotNull @NotNull String playerName) Gets the number of warns a user has given as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getWarnsGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has given " + count + " warns"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of warns given, or 0 if the player doesn't exist
-
getKicksGiven
Gets the number of kicks a user has given as a staff member.Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getKicksGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has given " + count + " kicks"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of kicks given
-
getKicksGiven
@NotNull public @NotNull CompletableFuture<Integer> getKicksGiven(@NotNull @NotNull String playerName) Gets the number of kicks a user has given as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getKicksGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has given " + count + " kicks"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of kicks given, or 0 if the player doesn't exist
-
getNotesGiven
Gets the number of notes a user has written as a staff member.Example:
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000"); staffStats.getNotesGiven(uuid).thenAccept(count -> { getLogger().info("Staff member has written " + count + " notes"); });- Parameter:
uuid- The UUID of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of notes written
-
getNotesGiven
@NotNull public @NotNull CompletableFuture<Integer> getNotesGiven(@NotNull @NotNull String playerName) Gets the number of notes a user has written as a staff member.This is an overloaded method that accepts a player name instead of UUID.
Example:
staffStats.getNotesGiven("PlayerName").thenAccept(count -> { getLogger().info("Staff member has written " + count + " notes"); });- Parameter:
playerName- The name of the staff member- Gibt zurück:
- A CompletableFuture that completes with the number of notes written, or 0 if the player doesn't exist
-