SlotMapper
Package: com.hypixel.hytale.server.npc.asset.builder
public class SlotMapperMaps 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.
Constants
Section titled “Constants”| Constant | Type | Value |
|---|---|---|
NO_SLOT | int | Integer.MIN_VALUE |
Constructors
Section titled “Constructors”public SlotMapper()public SlotMapper(boolean trackNames)Methods
Section titled “Methods”getSlot
Section titled “getSlot”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.
slotCount
Section titled “slotCount”public int slotCount()Returns the total number of allocated slots.
getSlotMappings
Section titled “getSlotMappings”@Nullablepublic Object2IntMap<String> getSlotMappings()Returns the name-to-slot map, or null if empty.
getNameMap
Section titled “getNameMap”@Nullablepublic Int2ObjectMap<String> getNameMap()Returns the slot-to-name reverse map, or null if name tracking is disabled.
Related Types
Section titled “Related Types”- ReferenceSlotMapper — extends this with reference objects
- BuilderSupport — uses multiple instances
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.