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。

导入相关包

如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。

mods.contenttweaker.item.MCToolType

已实现的接口

MCToolType implements the following interfaces. 这意味着对这个接口可用的任何方法也可以在此类上使用。

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!)

new mods.contenttweaker.item.MCToolType(name as String);
new mods.contenttweaker.item.MCToolType("pickaxe");
参数类型描述
nameStringThe name to be used

方法

getName

Gets the name of this toolType. The name is what is used in the Bracket expression after the <tooltype:

Return type: String

<tooltype:pickaxe>.getName();

hashCode

Returns the object's hash code

Return type: int

<tooltype:pickaxe>.hashCode();

toString

Get the string representation of this type. Is different from commandString!

Return type: String

<tooltype:pickaxe>.toString();

参数

名称类型可获得可设置
commandStringStringtruefalse
nameStringtruefalse

运算符

EQUALS

Compares if two given MCToolType objects are equal

<tooltype:pickaxe> == o as Object
<tooltype:pickaxe> == new MCToolType("pickaxe")
参数类型描述
oObjectThe other object

Casters

结果类型是否隐藏
Stringfalse