Interface HologramLines
public interface HologramLines
The editable lines of a hologram, following a top to bottom order (first line is top one, last line is the bottom
one).
- Since:
- 1
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemHologramLineappendItem(@Nullable org.bukkit.inventory.ItemStack itemStack) Adds a new item line at the bottom.@NotNull TextHologramLineappendText(@Nullable String text) Adds a new text line at the bottom.voidclear()Removes all the lines.@NotNull HologramLineget(int index) Returns the line at the given index.doubleThe total height in blocks occupied by the lines, including the gaps between them.@NotNull ItemHologramLineinsertItem(int beforeIndex, @NotNull org.bukkit.inventory.ItemStack itemStack) Inserts a new item line before the line at the given index, shifting all the lines below.@NotNull TextHologramLineinsertText(int beforeIndex, @Nullable String text) Inserts a new text line before the line at the given index, shifting all the lines below.voidremove(int index) Removes the line at the given index.booleanremove(@NotNull HologramLine line) Removes a line.intsize()Returns the current amount of lines.
-
Method Details
-
appendText
Adds a new text line at the bottom.- Parameters:
text- the content of the line, seeTextHologramLine.setText(String)- Returns:
- the created line
- Since:
- 1
-
appendItem
@NotNull @NotNull ItemHologramLine appendItem(@Nullable @Nullable org.bukkit.inventory.ItemStack itemStack) Adds a new item line at the bottom.- Parameters:
itemStack- the content of the line, seeItemHologramLine.setItemStack(ItemStack)- Returns:
- the created line
- Since:
- 1
-
insertText
Inserts a new text line before the line at the given index, shifting all the lines below.- Parameters:
beforeIndex- the index before which the line should be inserted, 0 to insert on toptext- the content of the line, seeTextHologramLine.setText(String)- Returns:
- the created line
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())- Since:
- 1
-
insertItem
@NotNull @NotNull ItemHologramLine insertItem(int beforeIndex, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Inserts a new item line before the line at the given index, shifting all the lines below.- Parameters:
beforeIndex- the index before which the line should be inserted, 0 to insert on topitemStack- the content of the line, seeItemHologramLine.setItemStack(ItemStack)- Returns:
- the created line
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())- Since:
- 1
-
get
Returns the line at the given index.- Parameters:
index- the index of the line to retrieve- Returns:
- the line at the given index
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())- Since:
- 1
-
remove
void remove(int index) Removes the line at the given index.- Parameters:
index- the index of the line to remove- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())- Since:
- 1
-
remove
Removes a line.- Parameters:
line- the line to be removed- Returns:
- if the line was found and removed
- Since:
- 1
-
clear
void clear()Removes all the lines.- Since:
- 1
-
size
int size()Returns the current amount of lines.- Returns:
- the current amount of lines
- Since:
- 1
-
getHeight
double getHeight()The total height in blocks occupied by the lines, including the gaps between them.- Returns:
- the total height of the lines
- Since:
- 1
-