Class CustomFilter

java.lang.Object
studio.magemonkey.codex.mccore.config.CustomFilter

public class CustomFilter extends Object

A custom filter to apply to language messages

This can be used to insert data such as player names, stats, or other data

  • Constructor Details

    • CustomFilter

      public CustomFilter(String token, String replacement)

      Creates a new custom filter

      Parameters:
      token - string to search for to replace (e.g. "{player}")
      replacement - string to replace the token with (e.g. "Bob")
  • Method Details

    • getToken

      public String getToken()
      Gets the token string of the filter
      Returns:
      token string
    • getReplacement

      public String getReplacement()
      Gets the replacement string of the filter
      Returns:
      replacement string
    • setReplacement

      public CustomFilter setReplacement(String replacement)
      Sets the replacement string for the filter
      Parameters:
      replacement - replacement
    • apply

      public String apply(String string)
      Applies the filter to the string
      Parameters:
      string - string to apply to
    • apply

      public void apply(StringBuilder sb)
      Applies the filter to the string builder
      Parameters:
      sb - string builder to apply to