If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at
the top of the file.
Attempts to automatically fix the given input string, if possible, so that it can be used to build a well-formed ResourceLocation. IllegalArgumentException If the string cannot be automatically fixed. ResourceLocationException If the string cannot be automatically fixed.
Returns: The fixed string.
script.zs
// NameUtil.fixing(input as string) as string;
NameUtil.fixing(myString);
Parameters:
input: stringType: string
- The string that should be fixed to a ResourceLocation-compatible format.
Return Type:
string
static fixing(input as string, mistakeHandler as BiConsumer<string, List<string>>) as string
Attempts to automatically fix the given input string, if possible, so that it can be used to build a well-formed ResourceLocation. IllegalArgumentException If the string cannot be automatically fixed. ResourceLocationException If the string cannot be automatically fixed.
Returns: The fixed string.
script.zs
// NameUtil.fixing(input as string, mistakeHandler as BiConsumer<string, List<string>>) as string;
NameUtil.fixing(myString, myBiConsumer);
Parameters:
input: stringType: string
- The string that should be fixed to a ResourceLocation-compatible format.
mistakeHandler: BiConsumer<string, List<string>>Type: BiConsumer<string, 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.
static fromFixedName(input as string) as ResourceLocation
Creates a ResourceLocation from the given input, if possible, while fixing mistakes that may be present in the string. IllegalArgumentException If the string cannot be automatically fixed. ResourceLocationException If the string cannot be automatically fixed.
static fromFixedName(input as string, mistakeHandler as BiConsumer<string, List<string>>) as ResourceLocation
Creates a ResourceLocation from the given input, if possible, while fixing mistakes that may be present in the string. IllegalArgumentException If the string cannot be automatically fixed. ResourceLocationException If the string cannot be automatically fixed.
// NameUtil.fromFixedName(input as string, mistakeHandler as BiConsumer<string, List<string>>) as ResourceLocation;
NameUtil.fromFixedName(myString, myBiConsumer);
Parameters:
input: stringType: string
- The string that should be fixed and converted to a ResourceLocation.
mistakeHandler: BiConsumer<string, List<string>>Type: BiConsumer<string, 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.