BlockState
, Colorable
, Metadatable
, PersistentDataHolder
, TileState
public interface Sign extends TileState, Colorable
Modifier and Type | Method | Description |
---|---|---|
String |
getLine(int index) |
Gets the line of text at the specified index.
|
String[] |
getLines() |
Gets all the lines of text currently on this sign.
|
boolean |
isEditable() |
Marks whether this sign can be edited by players.
|
void |
setEditable(boolean editable) |
Marks whether this sign can be edited by players.
|
void |
setLine(int index,
String line) |
Sets the line of text at the specified index.
|
getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
getMetadata, hasMetadata, removeMetadata, setMetadata
getPersistentDataContainer
@NotNull String[] getLines()
@NotNull String getLine(int index) throws IndexOutOfBoundsException
For example, getLine(0) will return the first line of text.
index
- Line number to get the text from, starting at 0IndexOutOfBoundsException
- Thrown when the line does not existvoid setLine(int index, @NotNull String line) throws IndexOutOfBoundsException
For example, setLine(0, "Line One") will set the first line of text to "Line One".
index
- Line number to set the text at, starting from 0line
- New text to set at the specified indexIndexOutOfBoundsException
- If the index is out of the range 0..3boolean isEditable()
void setEditable(boolean editable)
editable
- if this sign is currently editableCopyright © 2019. All rights reserved.