Skip to content

BuilderParameters

Package: com.hypixel.hytale.server.npc.asset.builder

public class BuilderParameters

Manages the parameter definitions and expression scope for a builder. Parameters are defined in a "Parameters" JSON block and consist of expressions with optional type hints, validation constraints, descriptions, and privacy flags. The class also manages the compile context for expression compilation and dependency tracking.

ConstantValue
KEY_PARAMETERS"Parameters"
KEY_IMPORT_STATES"_ImportStates"
KEY_INTERFACE"Interface"
FieldTypeDescription
parametersMap<String, Parameter>Named parameter definitions.
scopeStdScopeThe expression evaluation scope.
compileContextCompileContextContext for compiling expressions.
fileNameStringSource file name.
dependenciesIntSetBuilder dependency indices.
interfaceCodeStringInterface code for component matching.
public void readJSON(@Nonnull JsonObject jsonObject, @Nonnull StateMappingHelper stateHelper)

Reads the "Parameters" block from JSON. Parses each entry as a Parameter, and handles "_ImportStates" for component state import mapping.

public void addParametersToScope()

Adds all parameter expressions to the scope.

public ValueType getParameterType(String name)

Returns the value type of a parameter, or VOID if not found or private.

compile / getInstructions / getConstantOperand

Section titled “compile / getInstructions / getConstantOperand”
public ValueType compile(@Nonnull String expression)
public List<ExecutionContext.Instruction> getInstructions()
@Nullable
public ExecutionContext.Operand getConstantOperand()

Expression compilation methods delegating to the compile context.

public StdScope getScope()
@Nonnull
public StdScope createScope()
public void validateNoDuplicateParameters(@Nonnull BuilderParameters other)

Ensures no parameter name collides with a parent scope’s parameter.

public static class Parameter

A single parameter definition containing an expression, description, validation/confinement code, and privacy flag.

ConstantValue
KEY_VALUE"Value"
KEY_TYPE_HINT"TypeHint"
KEY_VALIDATE"Validate"
KEY_CONFINE"Confine"
KEY_DESCRIPTION"Description"
KEY_PRIVATE"Private"
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.