MC样式
Link to mc样式
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.util.text.MCStyle;
Constructor #构造函数
Link to constructor-构造函数
No Description Provided
ZenScript Copynew MCStyle() as MCStyle
new MCStyle();
使用方式
Link to 使用方式
Name: applyFormatting
Applies the formatting characteristics (Bold, Italic, Obfucated, etc) of the given MCTExtFormatting as well as the colour of the formatting.
Returns: A new MCStyle with the given Formatting.
Return Type: MCStyle
ZenScript CopyMCStyle.applyFormatting(formatting as TextFormatting) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 格式化 | 类型 TextFormatting | 描述 The formatting to set. |
Name: equals
Return Type: boolean
ZenScript CopyMCStyle.equals(other as Object) as boolean
参数 | 类型 | 描述 |
---|---|---|
参数 other | 类型 Object | 描述 No Description Provided |
Name: getBold
Return Type: boolean
ZenScript Copy// MCStyle.getBold() as boolean
new MCStyle().getBold();
Name: getColor
Return Type: int
ZenScript Copy// MCStyle.getColor() as int
new MCStyle().getColor();
Name: getFontId
Return Type: MCResourceLocation
ZenScript Copy// MCStyle.getFontId() as MCResourceLocation
new MCStyle().getFontId();
Name: getInsertion
Return Type: string
ZenScript Copy// MCStyle.getInsertion() as string
new MCStyle().getInsertion();
Name: getItalic
Return Type: boolean
ZenScript Copy// MCStyle.getItalic() as boolean
new MCStyle().getItalic();
Name: getObfuscated
Return Type: boolean
ZenScript Copy// MCStyle.getObfuscated() as boolean
new MCStyle().getObfuscated();
Name: getStrikethrough
Return Type: boolean
ZenScript Copy// MCStyle.getStrikethrough() as boolean
new MCStyle().getStrikethrough();
Name: getUnderlined
Return Type: boolean
ZenScript Copy// MCStyle.getUnderlined() as boolean
new MCStyle().getUnderlined();
Name: hashCode
Return Type: int
ZenScript Copy// MCStyle.hashCode() as int
new MCStyle().hashCode();
Name: isEmpty
Whether or not this style is empty (inherits everything from the parent).
Return Type: boolean
ZenScript Copy// MCStyle.isEmpty() as boolean
new MCStyle().isEmpty();
Name: setBold
Return Type: MCStyle
ZenScript CopyMCStyle.setBold(boldIn as bool?) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 boldIn | 类型 bool? | 描述 No Description Provided |
Name: setColor
Return Type: MCStyle
ZenScript CopyMCStyle.setColor(colour as int) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 colour | 类型 int | 描述 No Description Provided |
Name: setColor
Return Type: MCStyle
ZenScript CopyMCStyle.setColor(formatting as TextFormatting) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 格式化 | 类型 TextFormatting | 描述 No Description Provided |
Name: setFontId
Return Type: MCStyle
ZenScript CopyMCStyle.setFontId(location as MCResourceLocation) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 位置 | 类型 MCResourceLocation | 描述 No Description Provided |
Name: setFormatting
Sets the formatting of the style.
This will only take the colour of the text formatting, so using <formatting:obfuscated>
would not do anything as it does not have a colour. If you want to take the actual characteristics of the MCTextFormatting, use MCStyle#applyFormatting(MCTextFormatting)
Returns: A new MCStyle with the given Formatting.
Return Type: MCStyle
ZenScript CopyMCStyle.setFormatting(formatting as TextFormatting) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 格式化 | 类型 TextFormatting | 描述 The formatting to set. |
Name: setInsertion
Set a text to be inserted into Chat when the component is shift-clicked
Return Type: MCStyle
ZenScript CopyMCStyle.setInsertion(insertion as string) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 插入 | 类型 string | 描述 No Description Provided |
Name: setItalic
Return Type: MCStyle
ZenScript CopyMCStyle.setItalic(italic as bool?) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 italic | 类型 bool? | 描述 No Description Provided |
Name: setObfuscated
Return Type: MCStyle
ZenScript CopyMCStyle.setObfuscated(obfuscated as bool?) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 obfuscated | 类型 bool? | 描述 No Description Provided |
Name: setStrikethrough
Return Type: MCStyle
ZenScript CopyMCStyle.setStrikethrough(strikethrough as bool?) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 strikethrough | 类型 bool? | 描述 No Description Provided |
Name: setUnderlined
Return Type: MCStyle
ZenScript CopyMCStyle.setUnderlined(underlined as bool?) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 下划线 | 类型 bool? | 描述 No Description Provided |
Name: setUnderlined
Return Type: MCStyle
ZenScript CopyMCStyle.setUnderlined(underlined as boolean) as MCStyle
参数 | 类型 | 描述 |
---|---|---|
参数 下划线 | 类型 布尔值 | 描述 No Description Provided |
Name: toString
Return Type: string
ZenScript Copy// MCStyle.toString() as string
new MCStyle().toString();