Interface InlineMatch

All Known Implementing Classes:
InlineMatch.DataMatch, InlineMatch.TextMatch

public interface InlineMatch
Represents some match from a matcher.

A match is attached to some input text by a matcher and is expected to provide styled characters to the CharacterVisitor in place of the text segment it's attached to.

InlineMatch.DataMatch will work for most use cases.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    A match representing some data.
    static class 
    A match representing some text.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    accept(net.minecraft.text.CharacterVisitor visitor, int index, net.minecraft.text.Style currentStyle)
    Supplies styled characters
    int
    Gets the length of this match
  • Method Details

    • accept

      int accept(net.minecraft.text.CharacterVisitor visitor, int index, net.minecraft.text.Style currentStyle)
      Supplies styled characters
      Parameters:
      visitor - accepts the styled characters
      index - the number of characters given to this visitor so far
      currentStyle - the style that this text would otherwise have.
      Returns:
      the number of characters supplied to the visitor.
    • charLength

      int charLength()
      Gets the length of this match
      Returns:
      the number of characters we plan to give the visitor.