NameUtil
Importing the class
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.
Description
Set of utility methods related to names and naming in general.Members
static fixing(input as string) as string
Attempts to automatically fix the given
IllegalArgumentException If the string cannot be automatically fixed.
ResourceLocationException If the string cannot be automatically fixed.
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.
Parameters:
input: string
Type: 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
IllegalArgumentException If the string cannot be automatically fixed.
ResourceLocationException If the string cannot be automatically fixed.
element is the fixed string, and the second is a list of strings containing explanations
for all the identified mistakes.
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.
Parameters:
input: string
Type: 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 firstelement is the fixed string, and the second is a list of strings containing explanations
for all the identified mistakes.
Return Type:
string
static fromFixedName(input as string) as ResourceLocation
Creates a
IllegalArgumentException If the string cannot be automatically fixed.
ResourceLocationException If the string cannot be automatically fixed.
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.
Returns: A ResourceLocation
that represents the fixed input.
Parameters:
Return Type:
ResourceLocation
static fromFixedName(input as string, mistakeHandler as BiConsumer<string, List<string>>) as ResourceLocation
Creates a
IllegalArgumentException If the string cannot be automatically fixed.
ResourceLocationException If the string cannot be automatically fixed.
element is the fixed string, and the second is a list of strings containing explanations
for all the identified mistakes.
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.
Returns: A ResourceLocation
that represents the fixed input.
Parameters:
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 firstelement is the fixed string, and the second is a list of strings containing explanations
for all the identified mistakes.
Return Type:
ResourceLocation
static isAutogeneratedName(name as ResourceLocation) as bool
Verifies whether the given name has been autogenerated by CraftTweaker.
Returns: Whether the name has been autogenerated by CraftTweaker.
Parameters:
Return Type:
bool