Skip to content

ReferenceSlotMapper

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

public class ReferenceSlotMapper<T> extends SlotMapper

Extends SlotMapper to associate each slot with a lazily-created reference object. When a slot is requested, if it does not already have an associated object, one is created via the provided Supplier<T>. Used by BuilderSupport for timer slots.

ParameterDescription
TThe reference object type (e.g., Timer).
public ReferenceSlotMapper(Supplier<T> slotSupplier)
public ReferenceSlotMapper(Supplier<T> slotSupplier, boolean trackNames)
public T getReference(String name)

Returns the reference object for the named slot, creating it on first access.

public List<T> getReferenceList()

Returns the list of all created reference objects.

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