public interface Sign extends BlockState
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getLine(int index)
获取指定行的文本.
|
java.lang.String[] |
getLines()
获取这个告示牌上当前的文本.
|
void |
setLine(int index,
java.lang.String line)
设置指定索引行的文本.
|
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update
getMetadata, hasMetadata, removeMetadata, setMetadata
java.lang.String[] getLines()
原文: Gets all the lines of text currently on this sign.
java.lang.String getLine(int index) throws java.lang.IndexOutOfBoundsException
例如, getLine(0)将返回告示牌第一行的文本.
原文: Gets the line of text at the specified index.
For example, getLine(0) will return the first line of text.
index
- 要获取的文本的行数,从0开始java.lang.IndexOutOfBoundsException
- 在此行没有文本的时候抛出这个错误void setLine(int index, java.lang.String line) throws java.lang.IndexOutOfBoundsException
例如,setLine(0, "行1") 将设置告示牌第一行的文本为"行1".
请注意:从0开始数行.
原文: Sets the line of text at the specified index.
For example, setLine(0, "Line One") will set the first line of text to "Line One".
index
- 要设置的文本的行数,从0开始line
- 新的指定的文本索引java.lang.IndexOutOfBoundsException
- 如果索引超出了0-3的范围