From 8563454327d96a9758f731f9db87561b40bb401f Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 7 Jan 2011 14:52:28 +0000 Subject: Added Sign interface --- src/main/java/org/bukkit/block/Sign.java | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/org/bukkit/block/Sign.java (limited to 'src') diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java new file mode 100644 index 00000000..595c7836 --- /dev/null +++ b/src/main/java/org/bukkit/block/Sign.java @@ -0,0 +1,39 @@ + +package org.bukkit.block; + +import org.bukkit.Block; + +/** + * Represents either a SignPost or a WallSign + */ +public interface Sign extends Block { + /** + * Gets all the lines of text currently on this sign. + * + * @return Array of Strings containing each line of text + */ + public String[] getLines(); + + /** + * Gets the line of text at the specified index. + * + * For example, getLine(0) will return the first line of text. + * + * @param index Line number to get the text from, starting at 0 + * @throws IndexOutOfBoundsException Thrown when the line does not exist + * @return Text on the given line + */ + public String getLine(int index) throws IndexOutOfBoundsException; + + /** + * 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". + * + * @param index Line number to set the text at, starting from 0 + * @param line New text to set at the specified index + * @throws IndexOutOfBoundsException + */ + public void setLine(int index, String line) throws IndexOutOfBoundsException; +} -- cgit v1.2.3