Skip to content

BuilderComponent

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

public class BuilderComponent<T> extends BuilderBase<T>

A generic builder that wraps a BuilderObjectReferenceHelper to read a "Content" JSON object. Used when a builder category needs a simple wrapper around a referenced or inline component. Every BuilderFactory automatically registers a "Component" type that creates a BuilderComponent.

ParameterDescription
TThe runtime type this component produces.
public BuilderComponent(Class<T> classType)
@Override
public T build(@Nonnull BuilderSupport builderSupport)

Delegates to the inner BuilderObjectReferenceHelper.build().

@Override
public Class<T> category()

Returns the class type passed to the constructor.

@Nonnull
@Override
public Builder<T> readConfig(@Nonnull JsonElement data)

Reads a "Content" JSON object into the internal reference helper.

@Override
public boolean validate(String configName, @Nonnull NPCLoadTimeValidationHelper validationHelper, @Nonnull ExecutionContext context, Scope globalScope, @Nonnull List<String> errors)

Validates both this builder and the inner reference helper.

@Override
public boolean canRequireFeature()

Returns true if T is assignable from Action or Motion.

@Nonnull
@Override
public Schema toSchema(@Nonnull SchemaContext context)

Adds Class, Interface, Default, DefaultState, and ResetOnStateChange properties to the schema.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.