Class Lore
java.lang.Object
io.github.somesourcecode.someguiapi.scene.Lore
Represents the lore of an item.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends a blank line to the end of the lore.voidappendLine(net.kyori.adventure.text.Component line) Appends the given line to the end of the lore.voidclear()Removes all lines from the lore.static Lore.Buildercreate()Constructs a new empty lore builder.static Lore.BuilderConstructs a new lore builder with the lines of the given lore.List<net.kyori.adventure.text.Component>getLines()Returns the lines of the lore, represented as a list of components.voidinsertBlankLine(int index) Inserts a blank line at the specified index.voidinsertLine(int index, net.kyori.adventure.text.Component line) Inserts the given line at the specified index.voidremoveLine(int index) Removes the line at the specified index.voidsetBlankLine(int index) Sets the line at the specified index to a blank line.voidsetLine(int index, net.kyori.adventure.text.Component line) Replaces the line at the specified index with the given line.voidSets the lines of the lore.voidsetLines(net.kyori.adventure.text.Component... lines) Sets the lines of the lore.
-
Constructor Details
-
Lore
public Lore()Constructs a new empty lore. -
Lore
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
Returns the lines of the lore, represented as a list of components.- Returns:
- the lines of the lore
-
setLines
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 replaceline- 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 atline- 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
Constructs a new empty lore builder.- Returns:
- the lore builder
-
create
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
-