Skip to content

BuilderBaseWithType

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

public abstract class BuilderBaseWithType<T> extends BuilderBase<T> implements ISpawnable

An abstract builder base that adds a Type string field to the standard BuilderBase. Used by builder categories that require a secondary type discriminator in addition to the factory type tag. Implements ISpawnable to participate in the spawning system.

ParameterDescription
TThe runtime type this builder produces.
FieldTypeDescription
typeStringThe type string read from the JSON Type key.
protected void readTypeKey(@Nonnull JsonElement data, String typeKey)

Reads the type discriminator from the JSON data using the specified key name. Validates the value is a non-empty string via StringNotEmptyValidator.

protected void readTypeKey(@Nonnull JsonElement data)

Reads the type discriminator using the default key "Type".

public String getType()

Returns the type string previously read from JSON.

@Override
public Builder<T> readCommonConfig(JsonElement data)

Delegates to BuilderBase.readCommonConfig.

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