资源位置
Link to 资源位置
导入类
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.resource.ResourceLocation;
已实现的接口
Link to 已实现的接口
ResourceLocation implements the following interfaces. That means all methods defined in these interfaces are also available in ResourceLocation
- Comparable<ResourceLocation>
Constructor #构造函数
Link to constructor-构造函数
ZenScript Copynew ResourceLocation(namespace as string, path as string) as ResourceLocation
参数 | 类型 | 描述 |
---|---|---|
参数 命名空间 | 类型 string | 描述 Usually a ModId |
参数 path | 类型 string | 描述 May only contain lower-cased alphanumeric values, as well as / and _ |
Casters
Link to casters
Result Type | 是否隐藏 |
---|---|
Result Type IData #数据 | 是否隐藏 true |
Result Type string | 是否隐藏 true |
使用方式
Link to 使用方式
Name: asData
Return Type: IData
ZenScript Copy// ResourceLocation.asData() as IData
myResourceLocation.asData();
Name: compareTo
Return Type: int
ZenScript CopyResourceLocation.compareTo(other as ResourceLocation) as int
参数 | 类型 |
---|---|
参数 other | 类型 资源位置 |
Name: equals
Return Type: boolean
ZenScript CopyResourceLocation.equals(other as Object) as boolean
参数 | 类型 |
---|---|
参数 other | 类型 Object |
Name: getNamespace
Return Type: string
ZenScript Copy// ResourceLocation.getNamespace() as string
myResourceLocation.getNamespace();
Name: getPath
Return Type: string
ZenScript Copy// ResourceLocation.getPath() as string
myResourceLocation.getPath();
Name: hashCode
Return Type: int
ZenScript Copy// ResourceLocation.hashCode() as int
myResourceLocation.hashCode();
Name: toString
Return Type: string
ZenScript Copy// ResourceLocation.toString() as string
myResourceLocation.toString();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 commandString #命令字符串 | 类型 string | 可获得 true | 可设置 false |
名称 命名空间 | 类型 string | 可获得 true | 可设置 false |
名称 path | 类型 string | 可获得 true | 可设置 false |