Klasse PunishmentStatus

java.lang.Object
me.kzlyth.api.status.PunishmentStatus

public class PunishmentStatus extends Object
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
  • 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 banned
      ipBanned - Whether the player is IP-banned
      muted - Whether the player is muted
      ipMuted - Whether the player is IP-muted
      activeCase - The active case ID, or null if none
      activeBanCase - The active ban case ID, or null if none
      activeMuteCase - The active mute case ID, or null if none
  • Methodendetails

    • isBanned

      public boolean isBanned()
      Checks if the player is currently banned (non-IP ban).
      Gibt zurück:
      true if the player is banned, false otherwise
    • isIpBanned

      public boolean isIpBanned()
      Checks if the player is currently IP-banned.
      Gibt zurück:
      true if the player is IP-banned, false otherwise
    • isMuted

      public boolean isMuted()
      Checks if the player is currently muted (non-IP mute).
      Gibt zurück:
      true if the player is muted, false otherwise
    • isIpMuted

      public boolean isIpMuted()
      Checks if the player is currently IP-muted.
      Gibt zurück:
      true if the player is IP-muted, false otherwise
    • hasActivePunishment

      public boolean hasActivePunishment()
      Checks if the player has any active punishment (banned or muted, including IP-based).
      Gibt zurück:
      true if the player has any active punishment, false otherwise
    • getActiveCase

      @Nullable public @Nullable Integer getActiveCase()
      Gets the active case ID.

      This represents the most recent active punishment case, if any.

      Gibt zurück:
      The active case ID, or null if none
    • getActiveBanCase

      @Nullable public @Nullable Integer 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 null if no active ban
    • getActiveMuteCase

      @Nullable public @Nullable Integer 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 null if no active mute
    • toString

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