Package studio.safechat.tests
Class MessageTooLongCheck
java.lang.Object
studio.thevipershow.safechat.api.checks.ChatCheck
studio.safechat.tests.MessageTooLongCheck
- All Implemented Interfaces:
Check
public final class MessageTooLongCheck extends ChatCheck
-
Field Summary
Fields inherited from class studio.thevipershow.safechat.api.checks.ChatCheck
DOMAIN_REGEX, IPV4_REGEX, PLAYER_PLACEHOLDER, PREFIX_PLACEHOLDER, SPLIT_SPACE
-
Constructor Summary
Constructors Constructor Description MessageTooLongCheck()
-
Method Summary
Modifier and Type Method Description boolean
check(ChatData data)
Perform a check on ChatData.boolean
getLoggingEnabled()
Gets the logging status for this checkjava.lang.String
getPunishmentCommand()
Get the command to execute when a punishment is required.long
getPunishmentRequiredValue()
Get after how often should a player trigger a punish.java.util.List<java.lang.String>
getWarningMessages()
Get the warning messages that will be displayed when the player fails a check.boolean
hasWarningEnabled()
Get the warning messages status.java.lang.String
replacePlaceholders(java.lang.String message, ChatData data)
Provide placeholders for your own check.Methods inherited from class studio.thevipershow.safechat.api.checks.ChatCheck
getBypassPermission, getCheckPriority, getName
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MessageTooLongCheck
public MessageTooLongCheck()
-
-
Method Details
-
check
Description copied from interface:Check
Perform a check on ChatData. The check can consist in anything, but it must follow these criteria: The check must return true if the player failed the check. The check must return false if the player passed the check.- Parameters:
data
- The chat data.- Returns:
- True if failed, false otherwise.
-
hasWarningEnabled
public boolean hasWarningEnabled()Description copied from interface:Check
Get the warning messages status.- Returns:
- True if a warning message should be sent upon the player failing a check.
-
getWarningMessages
@NotNull public java.util.List<java.lang.String> getWarningMessages()Description copied from interface:Check
Get the warning messages that will be displayed when the player fails a check.- Returns:
- The warning messages.
-
replacePlaceholders
@NotNull public java.lang.String replacePlaceholders(@NotNull java.lang.String message, @NotNull ChatData data)Description copied from interface:Check
Provide placeholders for your own check. Replace any placeholder with your data.- Parameters:
message
- The message that may contain placeholders.data
- The data (used for placeholders).- Returns:
- The message, modified if it had placeholders support.
-
getPunishmentRequiredValue
public long getPunishmentRequiredValue()Description copied from interface:Check
Get after how often should a player trigger a punish. For example 2 will mean each 2 failed checks, will trigger the punishment.- Returns:
- The interval value.
-
getPunishmentCommand
@NotNull public java.lang.String getPunishmentCommand()Description copied from interface:Check
Get the command to execute when a punishment is required. Placeholders may be used.- Returns:
- The command to execute.
-
getLoggingEnabled
public boolean getLoggingEnabled()Description copied from interface:Check
Gets the logging status for this check- Returns:
- True if logging is enabled for this check
-