NameUtil
Link to nameutil
Set of utility methods related to names and naming in general.
Импорт класса
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.util.NameUtil;
Static Methods
Link to static-methods
Name: fixing
Attempts to automatically fix the given input
string, if possible, so that it can be used to build a
well-formed ResourceLocation.
Returns: The fixed string.
Return Type: string
ZenScript CopyNameUtil.fixing(input as string) as string
Параметр | Тип | Описание |
---|---|---|
Параметр input | Тип string | Описание The string that should be fixed to a ResourceLocation-compatible format. |
Name: fixing
Attempts to automatically fix the given input
string, if possible, so that it can be used to build a
well-formed ResourceLocation.
Returns: The fixed string.
Return Type: string
ZenScript CopyNameUtil.fixing(input as string, mistakeHandler as BiConsumer<string,stdlib.List<string>>) as string
Параметр | Тип | Описание |
---|---|---|
Параметр input | Тип string | Описание The string that should be fixed to a ResourceLocation-compatible format. |
Параметр mistakeHandler | Тип BiConsumer<string,stdlib.List<string>> | Описание A bi-consumer that gets called if there were any mistakes in the original string. The first element is the fixed string, and the second is a list of strings containing explanations for all the identified mistakes. |
Name: fromFixedName
Creates a ResourceLocation from the given input
, if possible, while fixing mistakes that
may be present in the string.
Returns: A ResourceLocation that represents the fixed input.
Return Type: ResourceLocation
ZenScript CopyNameUtil.fromFixedName(input as string) as ResourceLocation
Параметр | Тип | Описание |
---|---|---|
Параметр input | Тип string | Описание The string that should be fixed and converted to a ResourceLocation. |
Name: fromFixedName
Creates a ResourceLocation from the given input
, if possible, while fixing mistakes that
may be present in the string.
Returns: A ResourceLocation that represents the fixed input.
Return Type: ResourceLocation
ZenScript CopyNameUtil.fromFixedName(input as string, mistakeHandler as BiConsumer<string,stdlib.List<string>>) as ResourceLocation
Параметр | Тип | Описание |
---|---|---|
Параметр input | Тип string | Описание The string that should be fixed and converted to a ResourceLocation. |
Параметр mistakeHandler | Тип BiConsumer<string,stdlib.List<string>> | Описание A bi-consumer that gets called if there were any mistakes in the original string. The first element is the fixed string, and the second is a list of strings containing explanations for all the identified mistakes. |
Name: isAutogeneratedName
Verifies whether the given name has been autogenerated by CraftTweaker.
Returns: Whether the name has been autogenerated by CraftTweaker.
Return Type: boolean
ZenScript CopyNameUtil.isAutogeneratedName(name as ResourceLocation) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр name | Тип ResourceLocation | Описание The name to verify. |