Klasse MuteTemplate

java.lang.Object
me.kzlyth.api.template.mute.MuteTemplate

public class MuteTemplate extends Object
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
  • 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 key
      name - The display name
      description - The description
      defaultReason - The default reason
      autoIpMute - Whether this template auto IP mutes
      escalation - The escalation configuration (can be null)
      durations - The list of duration levels
  • Methodendetails

    • getKey

      @NotNull public @NotNull String getKey()
      Gets the unique identifier key for this template.
      Gibt zurück:
      The template key (e.g., "spam", "toxicity")
    • getName

      @NotNull public @NotNull String getName()
      Gets the display name of this template.
      Gibt zurück:
      The display name
    • getDescription

      @NotNull public @NotNull String 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:
      true if this template auto IP mutes, false for regular mutes
    • getDefaultReason

      @NotNull public @NotNull String getDefaultReason()
      Gets the default reason for mutes using this template.
      Gibt zurück:
      The default reason
    • getEscalation

      @Nullable public @Nullable EscalationConfig getEscalation()
      Gets the escalation configuration.
      Gibt zurück:
      The escalation configuration, or null if escalation is disabled
    • getDurations

      @NotNull public @NotNull List<DurationLevel> 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

      @Nullable public @Nullable DurationLevel getDurationLevel(int offenseLevel)
      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 null if 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

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