Klasse Warn

java.lang.Object
me.kzlyth.api.warn.Warn

public class Warn extends Object
Represents a warning entry in Zenith-Mod.

This model contains information about a warning including the player, reason, staff member, timestamp, case ID, and template information.

Example:


 WarnAPI warnAPI = api.getWarnAPI();
 List<Warn> warnings = warnAPI.getWarningsByTemplate(uuid, "toxicity").join();
 for (Warn warn : warnings) {
     getLogger().info("Warn #" + warn.getCaseId() + ": " + warn.getReason());
     getLogger().info("Staff: " + warn.getStaffName());
     getLogger().info("Date: " + new Date(warn.getTimestamp()));
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • Warn

      public Warn(@NotNull UUID playerUuid, @NotNull @NotNull String playerName, @NotNull @NotNull String reason, @NotNull @NotNull String staffName, long timestamp, int caseId, @Nullable @Nullable String additionalData)
      Constructs a new Warn object.
      Parameter:
      playerUuid - The UUID of the warned player
      playerName - The name of the warned player
      reason - The reason for the warning
      staffName - The name of the staff member
      timestamp - The timestamp when issued
      caseId - The case ID
      additionalData - Additional data (JSON string), or null
  • Methodendetails

    • getPlayerUuid

      @NotNull public UUID getPlayerUuid()
      Gets the UUID of the warned player.
      Gibt zurück:
      The player's UUID
    • getPlayerName

      @NotNull public @NotNull String getPlayerName()
      Gets the name of the warned player at the time of warning.
      Gibt zurück:
      The player's name
    • getReason

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

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

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

      public int getCaseId()
      Gets the case ID associated with this warning.
      Gibt zurück:
      The case ID
    • getAdditionalData

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

      @Nullable public @Nullable String getTemplateName()
      Gets the template name if this warning was issued using a template.

      Returns null if this was a manual warning (not template-based).

      Gibt zurück:
      The template name, or null if not a template warning
    • toString

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