Interface Check

All Known Implementing Classes:
AddressCheck, CapsCheck, ChatCheck, FloodCheck, MessageTooLongCheck, RepetitionCheck, WordsBlacklistCheck

public interface Check
A check for chat events.
  • Method Summary

    Modifier and Type Method Description
    boolean check​(@NotNull ChatData data)
    Perform a check on ChatData.
    @NotNull java.lang.String getBypassPermission()
    The permission that will make this check be skipped.
    CheckPriority.Priority getCheckPriority()
    Get the priority of the check.
    boolean getLoggingEnabled()
    Gets the logging status for this check
    @NotNull java.lang.String getName()
    Get the name of this check.
    @NotNull java.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.
    @NotNull 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.
    @NotNull java.lang.String replacePlaceholders​(@NotNull java.lang.String message, @NotNull ChatData data)
    Provide placeholders for your own check.
  • Method Details

    • getBypassPermission

      @NotNull @NotNull java.lang.String getBypassPermission()
      The permission that will make this check be skipped. A player with this permission will never be checked. This can be used CheckPermission
      Returns:
      The permission.
    • getCheckPriority

      @NotNull CheckPriority.Priority getCheckPriority()
      Get the priority of the check. The priority of a check will influence the order of call of your check. Higher priority checks will get called before lower priority ones. If no annotation of type CheckPriority is present on the Check class, NORMAL priority will be used.
      Returns:
      The priority of the check.
    • getName

      @NotNull @NotNull java.lang.String getName()
      Get the name of this check. Note: You can instead extend ChatCheck and use annotation CheckName on your check class and you won't need to define this method.
      Returns:
      The check's name.
    • check

      boolean check​(@NotNull @NotNull ChatData data)
      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

      boolean hasWarningEnabled()
      Get the warning messages status.
      Returns:
      True if a warning message should be sent upon the player failing a check.
    • getWarningMessages

      @NotNull @NotNull java.util.List<java.lang.String> getWarningMessages()
      Get the warning messages that will be displayed when the player fails a check.
      Returns:
      The warning messages.
    • replacePlaceholders

      @NotNull @NotNull java.lang.String replacePlaceholders​(@NotNull @NotNull java.lang.String message, @NotNull @NotNull ChatData data)
      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

      long getPunishmentRequiredValue()
      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 @NotNull java.lang.String getPunishmentCommand()
      Get the command to execute when a punishment is required. Placeholders may be used.
      Returns:
      The command to execute.
    • getLoggingEnabled

      boolean getLoggingEnabled()
      Gets the logging status for this check
      Returns:
      True if logging is enabled for this check