Package net.risingworld.api.objects
Klasse Sign
java.lang.Object
net.risingworld.api.objects.Sign
Represents a sign object.
Example: Heal a player when he interacts with specific signs
- Siehe auch:
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
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.
-
Methodendetails
-
getID
public long getID()Gets the global, unique ID of the sign.- Gibt zurück:
- the unique object ID.
-
isValid
public boolean isValid()Checks if this instance is still valid.- Gibt zurück:
- true if the instance is valid, false if not.
-
getWorldPosition
Gets the world position of the sign.- Gibt zurück:
- the object world position.
-
getChunkPositionX
public int getChunkPositionX()Gets the x offset of the chunk (which contains the object).- Gibt zurück:
- the x chunk offset.
-
getChunkPositionY
public int getChunkPositionY()Gets the y offset of the chunk (which contains the object).- Gibt zurück:
- the y chunk offset.
-
getChunkPositionZ
public int getChunkPositionZ()Gets the z offset of the chunk (which contains the object).- Gibt zurück:
- the z chunk offset.
-
getChunkPosition
Gets the chunk position of the sign object.- Gibt zurück:
- the sign object chunk coordinates.
-
getText
Gets the text of this sign. May be null.- Gibt zurück:
- the text of this sign.
-
setText
Sets the text of this sign. To create a new line, use the escape character\n
.- Parameter:
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.- Gibt zurück:
- the font.
-
setFont
Sets the font for this sign.- Parameter:
font
- the new font.
-
getFontSize
public float getFontSize()Gets the font size of the sign. By default it's 1.0- Gibt zurück:
- the font size of the sign.
-
setFontSize
public void setFontSize(float size) Sets a new font size for the sign.- Parameter:
size
- the new font size.
-
getTextAnchor
Gets the text anchor, i.e the pivot positioni of the text.- Gibt zurück:
- the text anchor of the text.
-
setTextAnchor
Sets the text anchor, i.e the pivot position of the text.- Parameter:
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.- Gibt zurück:
- 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.- Gibt zurück:
- the actual object representation in the world.
-
equals
-
hashCode
public int hashCode()
-