Klasse ActiveBanInfo

java.lang.Object
me.kzlyth.api.ban.ActiveBanInfo

public class ActiveBanInfo extends Object
Represents complete information about an active ban for a player.

This model contains all relevant information about an active ban including case ID, reason, duration, expiration time, staff member, and whether it's permanent.

Example:


 BanAPI banAPI = api.getBanAPI();
 ActiveBanInfo banInfo = banAPI.getActiveBanInfo(uuid).join();
 if (banInfo != null) {
     getLogger().info("Player is banned: " + banInfo.getReason());
     getLogger().info("Case ID: " + banInfo.getCaseId());
     if (banInfo.isPermanent()) {
         getLogger().info("Ban is permanent");
     } else {
         getLogger().info("Ban expires at: " + new Date(banInfo.getExpiresAt()));
     }
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • ActiveBanInfo

      public ActiveBanInfo(int caseId, @NotNull @NotNull String reason, long duration, long timestamp, @NotNull @NotNull String staffName, @NotNull UUID staffUuid, boolean ipBan, @Nullable @Nullable String additionalData)
      Constructs a new ActiveBanInfo object.
      Parameter:
      caseId - The case ID
      reason - The reason for the ban
      duration - The duration in milliseconds, or -1 for permanent
      timestamp - The timestamp when the ban was issued
      staffName - The name of the staff member
      staffUuid - The UUID of the staff member
      ipBan - Whether this is an IP ban
      additionalData - Additional data (JSON string), or null
  • Methodendetails

    • getCaseId

      public int getCaseId()
      Gets the case ID of the active ban.
      Gibt zurück:
      The case ID
    • getReason

      @NotNull public @NotNull String getReason()
      Gets the reason for the ban.
      Gibt zurück:
      The reason
    • getDuration

      public long getDuration()
      Gets the duration of the ban in milliseconds.
      Gibt zurück:
      The duration in milliseconds, or -1 for permanent
    • getTimestamp

      public long getTimestamp()
      Gets the timestamp when the ban was issued.
      Gibt zurück:
      Timestamp in milliseconds since epoch
    • getExpiresAt

      public long getExpiresAt()
      Gets the timestamp when the ban expires.
      Gibt zurück:
      Timestamp in milliseconds since epoch, or -1 for permanent bans
    • isPermanent

      public boolean isPermanent()
      Checks if the ban is permanent.
      Gibt zurück:
      true if the ban is permanent, false otherwise
    • getStaffName

      @NotNull public @NotNull String getStaffName()
      Gets the name of the staff member who issued the ban.
      Gibt zurück:
      The staff member's name
    • getStaffUuid

      @NotNull public UUID getStaffUuid()
      Gets the UUID of the staff member who issued the ban.
      Gibt zurück:
      The staff member's UUID
    • isIpBan

      public boolean isIpBan()
      Checks if this is an IP ban.
      Gibt zurück:
      true if this is an IP ban, false otherwise
    • getAdditionalData

      @Nullable public @Nullable String getAdditionalData()
      Gets additional data associated with the ban.
      Gibt zurück:
      Additional data as JSON string, or null if none
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object