Package me.kzlyth.api.template.mute
Klasse DurationLevel
java.lang.Object
me.kzlyth.api.template.mute.DurationLevel
Represents a duration level within a mute template.
Each duration level corresponds to a specific offense level and defines the mute duration and reason suffix that will be applied.
Example:
MuteTemplateAPI templateAPI = api.getMuteTemplateAPI();
MuteTemplate template = templateAPI.getTemplate("spam").join();
if (template != null) {
DurationLevel level1 = template.getDurations().get(0);
getLogger().info("Level " + level1.getLevel() + " duration: " + level1.getDuration());
getLogger().info("Reason suffix: " + level1.getReasonSuffix());
getLogger().info("Is permanent: " + level1.isPermanent());
}
- Seit:
- 1.2.3
- Autor:
- Zenith-Studios
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDurationLevel(int level, @NotNull String duration, @NotNull String reasonSuffix) Constructs a new DurationLevel object. -
Methodenübersicht
-
Konstruktordetails
-
Methodendetails
-
getLevel
public int getLevel()Gets the offense level.- Gibt zurück:
- The offense level (1 = first offense, 2 = second offense, etc.)
-
getDuration
Gets the duration string.- Gibt zurück:
- The duration string (e.g., "1d", "2h", "30m", "0" for permanent)
-
getReasonSuffix
Gets the reason suffix.- Gibt zurück:
- The reason suffix to append to the reason (e.g., " (1st Offense)")
-
isPermanent
public boolean isPermanent()Checks if this duration level represents a permanent mute.- Gibt zurück:
trueif permanent (duration is "0"),falseotherwise
-
toString
-