MCToolType
Link to mctooltype
A Tooltype is used to identify what kind of blocks a tool can mine, or inversely, what kind of tool is required to mine a given block.
This class was added by a mod with mod-id contenttweaker
. 因此,如果要使用此功能,则需要安装此mod。
导入类
Link to 导入类
如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。
ZenScript Copymods.contenttweaker.item.MCToolType
已实现的接口
Link to 已实现的接口
MCToolType implements the following interfaces. 这意味着对这个接口可用的任何方法也可以在此类上使用。
Constructor #构造函数
Link to constructor-构造函数
Constructs a ToolType object. If one with the given name already exists, they will internally point to the same toolType. Otherwise, a new one with the name is created (The same holds true for Brackets as well!)
ZenScript Copynew mods.contenttweaker.item.MCToolType(name as String);
new mods.contenttweaker.item.MCToolType("pickaxe");
参数 | 类型 | 描述 |
---|---|---|
参数 name(名称) | 类型 字符串[string] | 描述 The name to be used |
使用方式
Link to 使用方式
getName
Link to getname
Gets the name of this toolType. The name is what is used in the Bracket expression after the <tooltype:
Return type: String
ZenScript Copy<tooltype:pickaxe>.getName();
hashCode
Link to hashcode
Returns the object's hash code
Return type: int
ZenScript Copy<tooltype:pickaxe>.hashCode();
toString
Link to tostring
Get the string representation of this type. Is different from commandString!
Return type: String
ZenScript Copy<tooltype:pickaxe>.toString();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 commandString #命令字符串 | 类型 字符串[string] | 可获得 true | 可设置 false |
名称 name(名称) | 类型 字符串[string] | 可获得 true | 可设置 false |
运算符
Link to 运算符
EQUALS
Link to equals
Compares if two given MCToolType objects are equal
ZenScript Copy<tooltype:pickaxe> == o as Object
<tooltype:pickaxe> == new MCToolType("pickaxe")
参数 | 类型 | 描述 |
---|---|---|
参数 o | 类型 Object | 描述 The other object |
Casters
Link to casters
结果类型 | 是否隐藏 |
---|---|
结果类型 字符串[string] | 是否隐藏 false |