Package me.kzlyth.api.warn
Klasse Warn
java.lang.Object
me.kzlyth.api.warn.Warn
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
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@Nullable StringGets additional data associated with this warning.intGets the case ID associated with this warning.@NotNull StringGets the name of the warned player at the time of warning.Gets the UUID of the warned player.@NotNull StringGets the reason for the warning.@NotNull StringGets the name of the staff member who issued the warning.@Nullable StringGets the template name if this warning was issued using a template.longGets the timestamp when the warning was issued.toString()
-
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 playerplayerName- The name of the warned playerreason- The reason for the warningstaffName- The name of the staff membertimestamp- The timestamp when issuedcaseId- The case IDadditionalData- Additional data (JSON string), or null
-
-
Methodendetails
-
getPlayerUuid
Gets the UUID of the warned player.- Gibt zurück:
- The player's UUID
-
getPlayerName
Gets the name of the warned player at the time of warning.- Gibt zurück:
- The player's name
-
getReason
Gets the reason for the warning.- Gibt zurück:
- The reason
-
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
Gets additional data associated with this warning.- Gibt zurück:
- Additional data as JSON string, or
nullif none
-
getTemplateName
Gets the template name if this warning was issued using a template.Returns
nullif this was a manual warning (not template-based).- Gibt zurück:
- The template name, or
nullif not a template warning
-
toString
-