java.lang.Object
io.github.somesourcecode.someguiapi.scene.Lore

public class Lore extends Object
Represents the lore of an item.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The builder for the Lore class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new empty lore.
    Lore(List<net.kyori.adventure.text.Component> lines)
    Constructs a new lore with the given lines.
    Lore(net.kyori.adventure.text.Component... lines)
    Constructs a new lore with the given lines.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends a blank line to the end of the lore.
    void
    appendLine(net.kyori.adventure.text.Component line)
    Appends the given line to the end of the lore.
    void
    Removes all lines from the lore.
    Constructs a new empty lore builder.
    create(Lore lore)
    Constructs a new lore builder with the lines of the given lore.
    List<net.kyori.adventure.text.Component>
    Returns the lines of the lore, represented as a list of components.
    void
    insertBlankLine(int index)
    Inserts a blank line at the specified index.
    void
    insertLine(int index, net.kyori.adventure.text.Component line)
    Inserts the given line at the specified index.
    void
    removeLine(int index)
    Removes the line at the specified index.
    void
    setBlankLine(int index)
    Sets the line at the specified index to a blank line.
    void
    setLine(int index, net.kyori.adventure.text.Component line)
    Replaces the line at the specified index with the given line.
    void
    setLines(List<net.kyori.adventure.text.Component> lines)
    Sets the lines of the lore.
    void
    setLines(net.kyori.adventure.text.Component... lines)
    Sets the lines of the lore.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Lore

      public Lore()
      Constructs a new empty lore.
    • Lore

      public Lore(List<net.kyori.adventure.text.Component> lines)
      Constructs a new lore with the given lines.
      Parameters:
      lines - the lines of the lore
    • Lore

      public Lore(net.kyori.adventure.text.Component... lines)
      Constructs a new lore with the given lines.
      Parameters:
      lines - the lines of the lore
  • Method Details

    • getLines

      public List<net.kyori.adventure.text.Component> getLines()
      Returns the lines of the lore, represented as a list of components.
      Returns:
      the lines of the lore
    • setLines

      public void setLines(List<net.kyori.adventure.text.Component> lines)
      Sets the lines of the lore. Lines that were previously set will be removed.
      Parameters:
      lines - the lines of the lore
    • setLines

      public void setLines(net.kyori.adventure.text.Component... lines)
      Sets the lines of the lore. Lines that were previously set will be removed.
      Parameters:
      lines - the lines of the lore
    • setLine

      public void setLine(int index, net.kyori.adventure.text.Component line)
      Replaces the line at the specified index with the given line.
      Parameters:
      index - the index of the line to replace
      line - the line to replace the existing line with
    • insertLine

      public void insertLine(int index, net.kyori.adventure.text.Component line)
      Inserts the given line at the specified index.
      Parameters:
      index - the index to insert the line at
      line - the line to insert
    • appendLine

      public void appendLine(net.kyori.adventure.text.Component line)
      Appends the given line to the end of the lore.
      Parameters:
      line - the line to append
    • setBlankLine

      public void setBlankLine(int index)
      Sets the line at the specified index to a blank line.
      Parameters:
      index - the index of the line to set to a blank line
    • insertBlankLine

      public void insertBlankLine(int index)
      Inserts a blank line at the specified index.
      Parameters:
      index - the index to insert the blank line at
    • appendBlankLine

      public void appendBlankLine()
      Appends a blank line to the end of the lore.
    • removeLine

      public void removeLine(int index)
      Removes the line at the specified index.
      Parameters:
      index - the index of the line to remove
    • clear

      public void clear()
      Removes all lines from the lore.
    • create

      public static Lore.Builder create()
      Constructs a new empty lore builder.
      Returns:
      the lore builder
    • create

      public static Lore.Builder create(Lore lore)
      Constructs a new lore builder with the lines of the given lore.
      Parameters:
      lore - the lore to copy the lines from
      Returns:
      the lore builder