Package me.kzlyth.api.template.mute
Klasse MuteTemplate
java.lang.Object
me.kzlyth.api.template.mute.MuteTemplate
Represents a mute template (custom mute configuration) in Zenith-Mod.
Mute templates provide pre-configured mute settings including duration levels, escalation rules, and default reasons. Templates support automatic escalation where mute durations increase with repeat offenses.
Example:
MuteTemplateAPI templateAPI = api.getMuteTemplateAPI();
MuteTemplate template = templateAPI.getTemplate("spam").join();
if (template != null) {
getLogger().info("Template: " + template.getName());
getLogger().info("Description: " + template.getDescription());
getLogger().info("Auto IP mute: " + template.isAutoIpMute());
getLogger().info("Default reason: " + template.getDefaultReason());
if (template.getEscalation() != null) {
getLogger().info("Escalation enabled: " + template.getEscalation().isEnabled());
}
getLogger().info("Duration levels: " + template.getDurations().size());
}
- Seit:
- 1.2.3
- Autor:
- Zenith-Studios
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMuteTemplate(@NotNull String key, @NotNull String name, @NotNull String description, @NotNull String defaultReason, boolean autoIpMute, @Nullable EscalationConfig escalation, @NotNull List<DurationLevel> durations) Constructs a new MuteTemplate object. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@NotNull StringGets the default reason for mutes using this template.@NotNull StringGets the description of this template.@Nullable DurationLevelgetDurationLevel(int offenseLevel) Gets the duration level for a specific offense level.@NotNull List<DurationLevel> Gets the list of duration levels for this template.@Nullable EscalationConfigGets the escalation configuration.@NotNull StringgetKey()Gets the unique identifier key for this template.intGets the maximum offense level configured for this template.@NotNull StringgetName()Gets the display name of this template.booleanChecks if this template automatically IP mutes.toString()
-
Konstruktordetails
-
MuteTemplate
public MuteTemplate(@NotNull @NotNull String key, @NotNull @NotNull String name, @NotNull @NotNull String description, @NotNull @NotNull String defaultReason, boolean autoIpMute, @Nullable @Nullable EscalationConfig escalation, @NotNull @NotNull List<DurationLevel> durations) Constructs a new MuteTemplate object.- Parameter:
key- The unique identifier keyname- The display namedescription- The descriptiondefaultReason- The default reasonautoIpMute- Whether this template auto IP mutesescalation- The escalation configuration (can be null)durations- The list of duration levels
-
-
Methodendetails
-
getKey
Gets the unique identifier key for this template.- Gibt zurück:
- The template key (e.g., "spam", "toxicity")
-
getName
Gets the display name of this template.- Gibt zurück:
- The display name
-
getDescription
Gets the description of this template.- Gibt zurück:
- The description
-
isAutoIpMute
public boolean isAutoIpMute()Checks if this template automatically IP mutes.- Gibt zurück:
trueif this template auto IP mutes,falsefor regular mutes
-
getDefaultReason
Gets the default reason for mutes using this template.- Gibt zurück:
- The default reason
-
getEscalation
Gets the escalation configuration.- Gibt zurück:
- The escalation configuration, or
nullif escalation is disabled
-
getDurations
Gets the list of duration levels for this template.Each duration level corresponds to a specific offense level and defines the mute duration and reason suffix that will be applied.
- Gibt zurück:
- The list of duration levels
-
getDurationLevel
Gets the duration level for a specific offense level.Returns the duration level that matches the specified offense level. If no exact match is found, returns the highest level or the first level.
- Parameter:
offenseLevel- The offense level (1 = first offense, 2 = second offense, etc.)- Gibt zurück:
- The duration level, or
nullif no durations are configured
-
getMaxOffenseLevel
public int getMaxOffenseLevel()Gets the maximum offense level configured for this template.- Gibt zurück:
- The maximum offense level, or 1 if no durations are configured
-
toString
-