Interface Sign
- All Superinterfaces:
BlockState, Colorable, Metadatable, PersistentDataHolder, PersistentDataViewHolder, TileState
- All Known Subinterfaces:
HangingSign
Represents a captured state of either a SignPost or a WallSign.
-
Method Summary
Modifier and TypeMethodDescriptionGets the player that is currently allowed to edit this sign.Gets the allowed editor's UUID.getColor()Deprecated.A sign may have multiple writable sides now.getInteractableSideFor(double x, double z) Compute the side facing the specific x and z coordinates.default SidegetInteractableSideFor(Position position) Compute the side facing the specific position.default SidegetInteractableSideFor(Entity entity) Compute the side facing the specified entity.default StringgetLine(int index) Deprecated.A sign may have multiple writable sides now.default String[]getLines()Deprecated.A sign may have multiple writable sides now.Return the side of the sign.getTargetSide(Player player) Gets the side of this sign the given player is currently standing on.default booleanDeprecated.useisWaxed()insteaddefault booleanDeprecated.A sign may have multiple writable sides now.booleanGets whether operator features are allowed on this sign.booleanisWaxed()Gets whether or not this sign has been waxed.default Componentline(int index) Deprecated.A sign may have multiple writable sides now.default voidDeprecated.A sign may have multiple writable sides now.lines()Deprecated.A sign may have multiple writable sides now.voidSets the allowed editor's UUID.default voidDeprecated.A sign may have multiple writable sides now.default voidsetEditable(boolean editable) Deprecated.usesetWaxed(boolean)insteaddefault voidsetGlowingText(boolean glowing) Deprecated.A sign may have multiple writable sides now.default voidDeprecated.A sign may have multiple writable sides now.voidsetOperatorFeaturesAllowed(boolean allowed) Sets whether operator features are allowed on this sign.voidsetWaxed(boolean waxed) Sets whether or not this sign has been waxed.Methods inherited from interface BlockState
copy, copy, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, isSuffocating, setBlockData, setData, setRawData, setType, update, update, updateMethods inherited from interface Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface TileState
getPersistentDataContainer, isSnapshot
-
Method Details
-
lines
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.lines().Gets all the lines of text currently on theSide.FRONTof this sign.- Returns:
- List of components containing each line of text
-
line
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.line(int).Gets the line of text at the specified index on theSide.FRONT.For example, getLine(0) will return the first line of text.
- Parameters:
index- Line number to get the text from, starting at 0- Returns:
- Text on the given line
- Throws:
IndexOutOfBoundsException- Thrown when the line does not exist
-
line
@Deprecated(since="1.20") default void line(int index, Component line) throws IndexOutOfBoundsException Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.line(int, Component).Sets the line of text at the specified index on theSide.FRONT.For example, setLine(0, "Line One") will set the first line of text to "Line One".
- Parameters:
index- Line number to set the text at, starting from 0line- New text to set at the specified index- Throws:
IndexOutOfBoundsException- If the index is out of the range 0..3
-
getLines
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.lines().Gets all the lines of text currently on theSide.FRONTof this sign.- Returns:
- Array of Strings containing each line of text
-
getLine
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.line(int).Gets the line of text at the specified index.For example, getLine(0) will return the first line of text on the
Side.FRONT.- Parameters:
index- Line number to get the text from, starting at 0- Returns:
- Text on the given line
- Throws:
IndexOutOfBoundsException- Thrown when the line does not exist
-
setLine
@Deprecated(since="1.20") default void setLine(int index, String line) throws IndexOutOfBoundsException Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.line(int, net.kyori.adventure.text.Component).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".
- Parameters:
index- Line number to set the text at, starting from 0line- New text to set at the specified index- Throws:
IndexOutOfBoundsException- If the index is out of the range 0..3
-
isEditable
Deprecated.useisWaxed()insteadMarks whether this sign can be edited by players.- Returns:
- if this sign is currently editable
-
setEditable
Deprecated.usesetWaxed(boolean)insteadMarks whether this sign can be edited by players.- Parameters:
editable- if this sign is currently editable
-
isWaxed
boolean isWaxed()Gets whether or not this sign has been waxed. If a sign has been waxed, it cannot be edited by a player.- Returns:
- if this sign is waxed
-
setWaxed
void setWaxed(boolean waxed) Sets whether or not this sign has been waxed. If a sign has been waxed, it cannot be edited by a player.- Parameters:
waxed- if this sign is waxed
-
isGlowingText
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.isGlowingText().Gets whether this sign has glowing text. Only affects theSide.FRONT.- Returns:
- if this sign has glowing text
-
setGlowingText
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andSignSide.setGlowingText(boolean).Sets whether this sign has glowing text. Only affects theSide.FRONT.- Parameters:
glowing- if this sign has glowing text
-
getColor
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andColorable.getColor().Gets the color of this object.
This may be null to represent the default color of an object, if the object has a special default color (e.g Shulkers). -
setColor
Deprecated.A sign may have multiple writable sides now. UsegetSide(Side)andColorable.setColor(org.bukkit.DyeColor).Sets the color of this object to the specified DyeColor.
This may be null to represent the default color of an object, if the object has a special default color (e.g Shulkers). -
getSide
-
getTargetSide
-
getAllowedEditor
Gets the player that is currently allowed to edit this sign.
Edits from other players will be rejected if this value is not null.
You should prefergetAllowedEditorUniqueId()if you don't need the player instance as this method will fetch the player from UUID.- Returns:
- the player allowed to edit this sign, or null
-
getAllowedEditorUniqueId
-
setAllowedEditorUniqueId
-
getInteractableSideFor
-
getInteractableSideFor
-
getInteractableSideFor
Compute the side facing the specific x and z coordinates.- Parameters:
x- the x coordz- the z coord- Returns:
- the side the coordinates are facing
-
isOperatorFeaturesAllowed
boolean isOperatorFeaturesAllowed()Gets whether operator features are allowed on this sign. When enabled, supported click events in the root component of each line are executed when the relevant side is used.- Returns:
- if operator features are allowed
-
setOperatorFeaturesAllowed
void setOperatorFeaturesAllowed(boolean allowed) Sets whether operator features are allowed on this sign.- Parameters:
allowed- whether operator features are allowed
-