Class PlainText
java.lang.Object
xyz.gmitch215.socketmc.util.render.text.Text
xyz.gmitch215.socketmc.util.render.text.PlainText
- All Implemented Interfaces:
 Serializable
- Direct Known Subclasses:
 BukkitText
Represents a text element with plain text.
- See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe color for this text element.protected StringThe text content for this text element.Fields inherited from class xyz.gmitch215.socketmc.util.render.text.Text
dropShadow, FONT_HEIGHT - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionempty()Creates a new text element with empty text content.intgetAlpha()Gets the alpha value for the color in this text element.intgetColor()Gets the color as an ARGB integer.getText()Gets the text content for this text element.Creates a new text element with the specified text content.voidsetAlpha(int alpha) Sets the alpha value for the color in this text element.voidsetColor(int color) Sets the color for this text element.voidSets the text content for this text element.toJSON()Serializes this text element to a JSON string compatible with the Minecraft Component format.Methods inherited from class xyz.gmitch215.socketmc.util.render.text.Text
isDropShadow, setDropShadow 
- 
Field Details
- 
text
The text content for this text element. - 
color
protected int colorThe color for this text element. 
 - 
 - 
Constructor Details
- 
PlainText
public PlainText()Constructs a new, empty text element. - 
PlainText
Constructs a new text element.- Parameters:
 text- Text Content
 - 
PlainText
Constructs a new text element.- Parameters:
 text- Text Contentcolor- Color
 - 
PlainText
Constructs a new text element.- Parameters:
 text- Text Contentcolor- Color as an ARGB integer
 
 - 
 - 
Method Details
- 
getText
Gets the text content for this text element.- Returns:
 - Text Content
 
 - 
setText
Sets the text content for this text element.- Parameters:
 text- Text Content- Throws:
 IllegalArgumentException- if the text is null
 - 
getColor
public int getColor()Description copied from class:TextGets the color as an ARGB integer. - 
setColor
public void setColor(int color) Sets the color for this text element.- Parameters:
 color- Color as an ARGB integer
 - 
getAlpha
public int getAlpha()Gets the alpha value for the color in this text element.- Returns:
 - Color Alpha
 
 - 
setAlpha
public void setAlpha(int alpha) Sets the alpha value for the color in this text element.- Parameters:
 alpha- Color Alpha
 - 
toJSON
Description copied from class:TextSerializes this text element to a JSON string compatible with the Minecraft Component format. - 
empty
Creates a new text element with empty text content.- Returns:
 - Empty Text Element
 
 - 
of
Creates a new text element with the specified text content.- Parameters:
 text- Text Content- Returns:
 - Text Element
 
 
 -