Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes
About Mekanism

BracketValidators

This class was added by a mod with mod-id mekanism. So you need to have this mod installed if you want to use this feature.

Importing the class

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.

script.zs
import mods.mekanism.api.BracketValidators;

This class allows you to check whether a certain Object exists or not before using the BracketHandlers class. All methods return a boolean that represents whether the passed in registry name or location has an Object associated to it.

Just like with the BracketHandlers, most of these are accessible through the /ct dump subcommands added by Mekanism or through their in-game names. Make sure to remove the prefix from the bracket you get, because that is handled by the static, specific method you use in this class. This means, no gas or other chemical prefix, just modid and name.

Static Methods

Validates if there is a Gas with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validateGasStack(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.

Validates if there is a InfuseType with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validateInfusionStack(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.

Validates if there is a Pigment with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validatePigmentStack(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.

Validates if there is a Slurry with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validateSlurryStack(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.

Validates if there is a ModuleData<MODULE> with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validateModuleData(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.

Validates if there is a RobitSkin with the given registry name.

Returns: true if valid, false otherwise.
Return Type: boolean

script.zs
BracketValidators.validateRobitSkin(tokens as string) as boolean
ParameterTypeDescription
Parameter
tokens
Type
string
Description
The resource location to validate.