MCResourceLocation

导入相关包

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
Copy
import crafttweaker.api.util.MCResourceLocation;

已实现的接口

MCResourceLocation implements the following interfaces. That means all methods defined in these interfaces are also available in MCResourceLocation

Constructor #构造函数

ZenScript
Copy
new MCResourceLocation(namespace as string, path as string) as MCResourceLocation
参数类型描述
命名空间stringUsually a ModId
pathstringMay only contain lower-cased alphanumeric values, as well as / and _

Casters

结果类型是否隐藏
IDatatrue
stringtrue

方法

asData

Return Type: IData

ZenScript
Copy
// MCResourceLocation.asData() as IData

myMCResourceLocation.asData();
compareTo

Return Type: int

ZenScript
Copy
MCResourceLocation.compareTo(other as MCResourceLocation) as int
参数类型描述
otherMCResourceLocationNo Description Provided
equals

Return Type: boolean

ZenScript
Copy
MCResourceLocation.equals(other as Object) as boolean
参数类型描述
otherObjectNo Description Provided
getNamespace

Return Type: string

ZenScript
Copy
// MCResourceLocation.getNamespace() as string

myMCResourceLocation.getNamespace();
getPath

Return Type: string

ZenScript
Copy
// MCResourceLocation.getPath() as string

myMCResourceLocation.getPath();
hashCode

Return Type: int

ZenScript
Copy
// MCResourceLocation.hashCode() as int

myMCResourceLocation.hashCode();
toString

Return Type: string

ZenScript
Copy
// MCResourceLocation.toString() as string

myMCResourceLocation.toString();

参数

名称类型可获得可设置描述
commandStringstringtruefalseNo Description Provided
命名空间stringtruefalseNo Description Provided
pathstringtruefalseNo Description Provided