Skip to content

BuilderObjectArrayHelper

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

public abstract class BuilderObjectArrayHelper<T, U> extends BuilderObjectHelper<T>

Abstract base for helpers that read a JSON array of builder objects. Each array element is read into a BuilderObjectReferenceHelper. Concrete subclasses (BuilderObjectListHelper, BuilderObjectMapHelper) define how the array elements are assembled into the final collection.

ParameterDescription
TThe collection type produced by build().
UThe element type produced by each array entry’s builder.
FieldTypeDescription
buildersBuilderObjectReferenceHelper[]Array of reference helpers, one per JSON array element.
labelStringLabel for breadcrumb reporting.
@Override
public void readConfig(@Nonnull JsonElement data, @Nonnull BuilderManager builderManager, @Nonnull BuilderParameters builderParameters, @Nonnull BuilderValidationHelper builderValidationHelper)

Reads a JSON array, creating a BuilderObjectReferenceHelper for each element. Throws if the element is not an array.

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

Validates each element that is not excluded from regular build.

@Override
public boolean isPresent()
public boolean isEmpty()
public boolean hasNoElements()
@Nonnull
protected BuilderObjectReferenceHelper<U> createReferenceHelper()

Creates a new reference helper. Overridable by subclasses (e.g., BuilderObjectStaticListHelper).

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