Skip to content

BuilderSupport

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

public class BuilderSupport

The runtime context passed to builders during the build() phase. Provides access to the BuilderManager, the NPC entity being configured, the entity store holder, the expression execution context, and a comprehensive set of slot mappers for flags, beacons, targets, positions, timers, search rays, parameters, instructions, block events, and entity events.

This is the central coordination point during NPC role construction, connecting the builder system to the entity store, state machine, instruction tree, and event systems.

public BuilderSupport(BuilderManager builderManager, @Nonnull NPCEntity npcEntity, Holder<EntityStore> holder, ExecutionContext executionContext, @Nonnull Builder<?> roleBuilder, RoleStats roleStats)
MethodReturnsDescription
getBuilderManager()BuilderManagerThe builder manager.
getEntity()NPCEntityThe NPC entity being built.
getHolder()Holder<EntityStore>The entity store holder.
getExecutionContext()ExecutionContextExpression execution context.
getParentSpawnable()Builder<?>The role builder.
getRoleStats()RoleStatsRole statistics.
getSensorScope()StdScopeExpression scope for sensor evaluation.

BuilderSupport maintains several SlotMapper and ReferenceSlotMapper instances for allocating named slots:

Slot FamilyMethodDescription
FlagsgetFlagSlot(String)Boolean flag slots.
BeaconsgetBeaconMessageSlot(String)Beacon message slots.
TargetsgetTargetSlot(String)Target entity slots (with name tracking).
PositionsgetPositionSlot(String)Vector3d position slots.
TimersgetTimerByName(String)Named timer references.
Search RaysgetSearchRaySlot(String)Search ray position slots.
ParametersgetParameterSlot(String)Parameter slots.
public int getInstructionSlot(@Nullable String name)
public void putInstruction(int slot, Instruction instruction)
@Nonnull
public Instruction[] getInstructionSlotMappings()

Manages the instruction tree slot assignments. Instructions are allocated lazily and stored by slot index.

public int getBlockEventSlot(BlockEventType type, int blockSet, double maxRange, boolean player)
public int getEntityEventSlot(EntityEventType type, int npcGroup, double maxRange, boolean player)

Allocate event observation slots for block and entity events via EventSlotMapper instances.

public void setModifiedStateMap(@Nonnull StateMappingHelper helper, @Nonnull StatePair[] map)
@Nonnull
public StatePair getMappedStatePair(int index)
public void popModifiedStateMap()

Manages the state mapping overlay stack for component state exports.

public void setToNewComponent()
public int getComponentIndex()
public void popComponent()
public void addComponentLocalStateMachine(int defaultState)

Manages the component index stack for nested component building.

public int getValueStoreStringSlot(String name)
public int getValueStoreIntSlot(String name)
public int getValueStoreDoubleSlot(String name)
public ValueStore.Builder getValueStoreBuilder()

Allocates named slots in the NPC’s runtime value store.

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