summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/block/Sign.java
blob: 0cbdd39a36169aa7c1d78b414099e15d7a5d0a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.bukkit.block;

/**
 * Represents a captured state of either a SignPost or a WallSign.
 */
public interface Sign extends BlockState {

    /**
     * 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.
     * <p>
     * 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.
     * <p>
     * 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 If the index is out of the range 0..3
     */
    public void setLine(int index, String line) throws IndexOutOfBoundsException;

    /**
     * Marks whether this sign can be edited by players.
     * <br>
     * This is a special value, which is not persisted. It should only be if a
     * placed sign is manipulated during the BlockPlaceEvent. Behaviour outside
     * of this event is undefined.
     *
     * @return if this sign is currently editable
     * @deprecated draft API
     */
    @Deprecated
    public boolean isEditable();

    /**
     * Marks whether this sign can be edited by players.
     * <br>
     * This is a special value, which is not persisted. It should only be if a
     * placed sign is manipulated during the BlockPlaceEvent. Behaviour outside
     * of this event is undefined.
     *
     * @param editable if this sign is currently editable
     * @deprecated draft API
     */
    @Deprecated
    public void setEditable(boolean editable);
}