Class ContextParagraph

java.lang.Object
io.github.somesourcecode.someguiapi.scene.lore.ContextParagraph
All Implemented Interfaces:
Paragraph, ReloadableParagraph

public class ContextParagraph extends Object implements ReloadableParagraph
The basic implementation of a ReloadableParagraph.
Since:
2.0.0
  • Constructor Details

    • ContextParagraph

      public ContextParagraph()
      Constructs a new empty context paragraph.
      Since:
      2.0.0
    • ContextParagraph

      public ContextParagraph(java.util.function.Function<RenderContext,Paragraph> contentGenerator)
      Constructs a new context paragraph with the given content generator.
      Parameters:
      contentGenerator - the content generator
      Since:
      2.0.0
  • Method Details

    • setContentGenerator

      public ContextParagraph setContentGenerator(java.util.function.Function<RenderContext,Paragraph> paragraphGenerator)
      Sets the content generator of the paragraph.
      Parameters:
      paragraphGenerator - the content generator
      Returns:
      the paragraph for method chaining
      Since:
      2.0.0
    • reload

      public void reload(RenderContext context)
      Description copied from interface: ReloadableParagraph
      Reloads the paragraph with the given context.
      Specified by:
      reload in interface ReloadableParagraph
      Parameters:
      context - the context in which the paragraph is rendered
    • getLines

      public List<net.kyori.adventure.text.Component> getLines()
      Description copied from interface: Paragraph
      Returns a list representing the lines of the paragraph.
      Specified by:
      getLines in interface Paragraph
      Returns:
      the lines of the paragraph