Klasse StatisticsAPI

java.lang.Object
me.kzlyth.api.statistics.StatisticsAPI

public class StatisticsAPI extends Object
Main API class for retrieving statistics from Zenith-Mod.

This API provides access to all statistics functionality through specialized sub-APIs:

Example usage:


 ZenithAPI api = ZenithAPI.getInstance();
 if (api != null) {
     StatisticsAPI statisticsAPI = api.getStatisticsAPI();
     
     // Get global statistics
     GlobalStatisticsAPI globalStats = statisticsAPI.getGlobalStatistics();
     globalStats.getTotalUsers().thenAccept(total -> {
         getLogger().info("Total registered users: " + total);
     });
     
     // Get user statistics
     UserStatisticsAPI userStats = statisticsAPI.getUserStatistics();
     UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
     userStats.getPunishmentCount(uuid).thenAccept(count -> {
         getLogger().info("User has received " + count + " punishments");
     });
     
     // Get staff statistics
     StaffStatisticsAPI staffStats = statisticsAPI.getStaffStatistics();
     staffStats.getPunishmentsGiven(uuid).thenAccept(count -> {
         getLogger().info("Staff member has given " + count + " punishments");
     });
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • StatisticsAPI

      public StatisticsAPI(@NotNull @NotNull me.kzlyth.ZenithMod plugin, @NotNull @NotNull ZenithAPI api)
      Constructs a new StatisticsAPI instance.
      Parameter:
      plugin - The plugin instance
      api - The main API instance
  • Methodendetails

    • getGlobalStatistics

      @NotNull public @NotNull GlobalStatisticsAPI getGlobalStatistics()
      Gets the global statistics API instance.

      The global statistics API provides methods to retrieve global statistics including total users, online count, banned/muted counts, and total punishments.

      Example:

      
       StatisticsAPI statisticsAPI = api.getStatisticsAPI();
       GlobalStatisticsAPI globalStats = statisticsAPI.getGlobalStatistics();
       
       globalStats.getTotalUsers().thenAccept(total -> {
           getLogger().info("Total registered users: " + total);
       });
       
       globalStats.getTotalPunishments().thenAccept(total -> {
           getLogger().info("Total punishments: " + total);
       });
       
      Gibt zurück:
      The global statistics API instance
    • getUserStatistics

      @NotNull public @NotNull UserStatisticsAPI getUserStatistics()
      Gets the user statistics API instance.

      The user statistics API provides methods to retrieve statistics about punishments a user has received, including bans, mutes, warns, kicks, and notes.

      Example:

      
       StatisticsAPI statisticsAPI = api.getStatisticsAPI();
       UserStatisticsAPI userStats = statisticsAPI.getUserStatistics();
       
       UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
       userStats.getPunishmentCount(uuid).thenAccept(count -> {
           getLogger().info("User has received " + count + " punishments");
       });
       
       userStats.getBanCount(uuid).thenAccept(count -> {
           getLogger().info("User has been banned " + count + " times");
       });
       
      Gibt zurück:
      The user statistics API instance
    • getStaffStatistics

      @NotNull public @NotNull StaffStatisticsAPI getStaffStatistics()
      Gets the staff statistics API instance.

      The staff statistics API provides methods to retrieve statistics about punishments a user has given as a staff member, including bans, mutes, warns, kicks, and notes written.

      Example:

      
       StatisticsAPI statisticsAPI = api.getStatisticsAPI();
       StaffStatisticsAPI staffStats = statisticsAPI.getStaffStatistics();
       
       UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
       staffStats.getPunishmentsGiven(uuid).thenAccept(count -> {
           getLogger().info("Staff member has given " + count + " punishments");
       });
       
       staffStats.getBansGiven(uuid).thenAccept(count -> {
           getLogger().info("Staff member has given " + count + " bans");
       });
       
      Gibt zurück:
      The staff statistics API instance