Skip to content

SlotMapper

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

public class SlotMapper

Maps string names to sequential integer slot indices. Used extensively by BuilderSupport to allocate named slots for flags, beacons, targets, positions, search rays, and parameters during NPC role building. Optionally tracks a reverse mapping from slot index to name.

ConstantTypeValue
NO_SLOTintInteger.MIN_VALUE
public SlotMapper()
public SlotMapper(boolean trackNames)
public int getSlot(String name)

Returns the slot index for the given name, creating a new slot if the name has not been seen before.

public int slotCount()

Returns the total number of allocated slots.

@Nullable
public Object2IntMap<String> getSlotMappings()

Returns the name-to-slot map, or null if empty.

@Nullable
public Int2ObjectMap<String> getNameMap()

Returns the slot-to-name reverse map, or null if name tracking is disabled.

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