Package net.risingworld.api.objects
Class Sign
java.lang.Object
net.risingworld.api.objects.Sign
Represents a sign object.
Example: Heal a player when he interacts with specific signs
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the chunk position of the sign object.int
Gets the x offset of the chunk (which contains the object).int
Gets the y offset of the chunk (which contains the object).int
Gets the z offset of the chunk (which contains the object).getFont()
Gets the font that is currently used by the sign.float
Gets the font size of the sign.long
getID()
Gets the global, unique ID of the sign.int
Gets the database id of the player who last modified the sign text.Gets the object element which represents this meta object in the world.getText()
Gets the text of this sign.Gets the text anchor, i.e the pivot positioni of the text.Gets the world position of the sign.int
hashCode()
boolean
isValid()
Checks if this instance is still valid.void
Sets the font for this sign.void
setFontSize
(float size) Sets a new font size for the sign.void
Sets the text of this sign.void
setTextAnchor
(TextAnchor anchor) Sets the text anchor, i.e the pivot position of the text.
-
Method Details
-
getID
public long getID()Gets the global, unique ID of the sign.- Returns:
- the unique object ID.
-
isValid
public boolean isValid()Checks if this instance is still valid.- Returns:
- true if the instance is valid, false if not.
-
getWorldPosition
Gets the world position of the sign.- Returns:
- the object world position.
-
getChunkPositionX
public int getChunkPositionX()Gets the x offset of the chunk (which contains the object).- Returns:
- the x chunk offset.
-
getChunkPositionY
public int getChunkPositionY()Gets the y offset of the chunk (which contains the object).- Returns:
- the y chunk offset.
-
getChunkPositionZ
public int getChunkPositionZ()Gets the z offset of the chunk (which contains the object).- Returns:
- the z chunk offset.
-
getChunkPosition
Gets the chunk position of the sign object.- Returns:
- the sign object chunk coordinates.
-
getText
Gets the text of this sign. May be null.- Returns:
- the text of this sign.
-
setText
Sets the text of this sign. To create a new line, use the escape character\n
.- Parameters:
text
- the text you want to set.- Example: Set a red text on the sign
- Example: Set a colored multi-line text on the sign
-
getFont
Gets the font that is currently used by the sign.- Returns:
- the font.
-
setFont
Sets the font for this sign.- Parameters:
font
- the new font.
-
getFontSize
public float getFontSize()Gets the font size of the sign. By default it's 1.0- Returns:
- the font size of the sign.
-
setFontSize
public void setFontSize(float size) Sets a new font size for the sign.- Parameters:
size
- the new font size.
-
getTextAnchor
Gets the text anchor, i.e the pivot positioni of the text.- Returns:
- the text anchor of the text.
-
setTextAnchor
Sets the text anchor, i.e the pivot position of the text.- Parameters:
anchor
- the new text anchor you want to set for the text.
-
getLastModifyPlayerDbID
public int getLastModifyPlayerDbID()Gets the database id of the player who last modified the sign text.- Returns:
- the player database id or -1 if the text was set by the game or the API.
-
getRelatedObject
Gets the object element which represents this meta object in the world.- Returns:
- the actual object representation in the world.
-
equals
-
hashCode
public int hashCode()
-