Package me.kzlyth.api.status
Klasse PunishmentStatus
java.lang.Object
me.kzlyth.api.status.PunishmentStatus
Represents the punishment status of a player.
This model contains information about a player's current punishment status including ban status, mute status (both regular and IP-based), and active case information.
Example:
PunishmentStatusAPI statusAPI = api.getPunishmentStatusAPI();
PunishmentStatus status = statusAPI.getPunishmentStatus(uuid).join();
if (status != null) {
if (status.isBanned() || status.isIpBanned()) {
getLogger().info("Player is banned");
}
if (status.isMuted() || status.isIpMuted()) {
getLogger().info("Player is muted");
}
Integer activeCase = status.getActiveCase();
if (activeCase != null) {
getLogger().info("Active case ID: " + activeCase);
}
}
- Seit:
- 1.2.3
- Autor:
- Zenith-Studios
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungPunishmentStatus(boolean banned, boolean ipBanned, boolean muted, boolean ipMuted, @Nullable Integer activeCase, @Nullable Integer activeBanCase, @Nullable Integer activeMuteCase) Constructs a new PunishmentStatus object. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@Nullable IntegerGets the active ban case ID.@Nullable IntegerGets the active case ID.@Nullable IntegerGets the active mute case ID.booleanChecks if the player has any active punishment (banned or muted, including IP-based).booleanisBanned()Checks if the player is currently banned (non-IP ban).booleanChecks if the player is currently IP-banned.booleanChecks if the player is currently IP-muted.booleanisMuted()Checks if the player is currently muted (non-IP mute).toString()
-
Konstruktordetails
-
PunishmentStatus
public PunishmentStatus(boolean banned, boolean ipBanned, boolean muted, boolean ipMuted, @Nullable @Nullable Integer activeCase, @Nullable @Nullable Integer activeBanCase, @Nullable @Nullable Integer activeMuteCase) Constructs a new PunishmentStatus object.- Parameter:
banned- Whether the player is bannedipBanned- Whether the player is IP-bannedmuted- Whether the player is mutedipMuted- Whether the player is IP-mutedactiveCase- The active case ID, ornullif noneactiveBanCase- The active ban case ID, ornullif noneactiveMuteCase- The active mute case ID, ornullif none
-
-
Methodendetails
-
isBanned
public boolean isBanned()Checks if the player is currently banned (non-IP ban).- Gibt zurück:
trueif the player is banned,falseotherwise
-
isIpBanned
public boolean isIpBanned()Checks if the player is currently IP-banned.- Gibt zurück:
trueif the player is IP-banned,falseotherwise
-
isMuted
public boolean isMuted()Checks if the player is currently muted (non-IP mute).- Gibt zurück:
trueif the player is muted,falseotherwise
-
isIpMuted
public boolean isIpMuted()Checks if the player is currently IP-muted.- Gibt zurück:
trueif the player is IP-muted,falseotherwise
-
hasActivePunishment
public boolean hasActivePunishment()Checks if the player has any active punishment (banned or muted, including IP-based).- Gibt zurück:
trueif the player has any active punishment,falseotherwise
-
getActiveCase
Gets the active case ID.This represents the most recent active punishment case, if any.
- Gibt zurück:
- The active case ID, or
nullif none
-
getActiveBanCase
Gets the active ban case ID.This represents the active ban punishment case, if any.
- Gibt zurück:
- The active ban case ID, or
nullif no active ban
-
getActiveMuteCase
Gets the active mute case ID.This represents the active mute punishment case, if any.
- Gibt zurück:
- The active mute case ID, or
nullif no active mute
-
toString
-