Package me.kzlyth.api.ban
Klasse ActiveBanInfo
java.lang.Object
me.kzlyth.api.ban.ActiveBanInfo
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
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungActiveBanInfo(int caseId, @NotNull String reason, long duration, long timestamp, @NotNull String staffName, UUID staffUuid, boolean ipBan, @Nullable String additionalData) Constructs a new ActiveBanInfo object. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@Nullable StringGets additional data associated with the ban.intGets the case ID of the active ban.longGets the duration of the ban in milliseconds.longGets the timestamp when the ban expires.@NotNull StringGets the reason for the ban.@NotNull StringGets the name of the staff member who issued the ban.Gets the UUID of the staff member who issued the ban.longGets the timestamp when the ban was issued.booleanisIpBan()Checks if this is an IP ban.booleanChecks if the ban is permanent.toString()
-
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 IDreason- The reason for the banduration- The duration in milliseconds, or -1 for permanenttimestamp- The timestamp when the ban was issuedstaffName- The name of the staff memberstaffUuid- The UUID of the staff memberipBan- Whether this is an IP banadditionalData- 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
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:
trueif the ban is permanent,falseotherwise
-
getStaffName
Gets the name of the staff member who issued the ban.- Gibt zurück:
- The staff member's name
-
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:
trueif this is an IP ban,falseotherwise
-
getAdditionalData
Gets additional data associated with the ban.- Gibt zurück:
- Additional data as JSON string, or
nullif none
-
toString
-