Interface ModerationMessageFormatter
public interface ModerationMessageFormatter
Fills the punishment placeholders for id, reason, dates and remaining time into the
messages shown to a punished player.
-
Method Summary
Modifier and TypeMethodDescriptioncreateMuteContext(FPlayer fPlayer, MuteChecker.Status status) Builds the message telling a player why they may not speak.replacePlaceholders(String message, String moderationId, String reason, String date, String time, String timeLeft) Fills in the placeholders from values that are already formatted for display.replacePlaceholders(String message, FPlayer fReceiver, long moderationId, long date, long time, String reason, boolean permanent) Fills in the placeholders from loose values, for punishments that were never stored.replacePlaceholders(String message, FPlayer fReceiver, ExternalModeration moderation) Fills in the placeholders from a punishment owned by another plugin.replacePlaceholders(String message, FPlayer fReceiver, Moderation moderation) Fills in the placeholders from a punishment issued by this plugin.
-
Method Details
-
createMuteContext
Builds the message telling a player why they may not speak.- Parameters:
fPlayer- the silenced playerstatus- what is stopping them- Returns:
- the message, or empty if nothing is
-
replacePlaceholders
Fills in the placeholders from a punishment issued by this plugin.- Parameters:
message- the text with placeholdersfReceiver- the player the text is for, which decides the date and time wordingmoderation- the punishment- Returns:
- the filled-in text
-
replacePlaceholders
Fills in the placeholders from a punishment owned by another plugin.- Parameters:
message- the text with placeholdersfReceiver- the player the text is formoderation- the punishment- Returns:
- the filled-in text
-
replacePlaceholders
String replacePlaceholders(String message, FPlayer fReceiver, long moderationId, long date, long time, String reason, boolean permanent) Fills in the placeholders from loose values, for punishments that were never stored.- Parameters:
message- the text with placeholdersfReceiver- the player the text is formoderationId- the punishment iddate- when it was issued, in millisecondstime- when it expires, in millisecondsreason- the stated reasonpermanent- whether it never expires- Returns:
- the filled-in text
-
replacePlaceholders
String replacePlaceholders(String message, String moderationId, String reason, String date, String time, String timeLeft) Fills in the placeholders from values that are already formatted for display.- Parameters:
message- the text with placeholdersmoderationId- the punishment idreason- the stated reasondate- the formatted issue datetime- the formatted expirytimeLeft- the formatted remaining time- Returns:
- the filled-in text
-