EventSlotMapper
Package: com.hypixel.hytale.server.npc.asset.builder
public class EventSlotMapper<EventType extends Enum<EventType>>Allocates integer slot indices for event observations during NPC role building. Each slot uniquely identifies a combination of event type and set identifier (e.g., a specific block set or NPC group). Also tracks the maximum observation range per slot.
Type Parameters
Section titled “Type Parameters”| Parameter | Description |
|---|---|
EventType | The enum type representing event categories (e.g., BlockEventType, EntityEventType). |
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
eventSets | Map<EventType, IntSet> | Set IDs registered per event type. |
eventSlotMappings | Map<EventType, Int2IntMap> | Set ID to slot index mapping per event type. |
eventSlotRanges | Int2DoubleMap | Maximum observation range per slot. |
nextEventSlot | int | Counter for allocating new slots. |
Constructor
Section titled “Constructor”public EventSlotMapper(Class<EventType> classType, EventType[] types)Methods
Section titled “Methods”getEventSets
Section titled “getEventSets”@Nonnullpublic Map<EventType, IntSet> getEventSets()getEventSlotMappings
Section titled “getEventSlotMappings”@Nonnullpublic Map<EventType, Int2IntMap> getEventSlotMappings()getEventSlotRanges
Section titled “getEventSlotRanges”@Nonnullpublic Int2DoubleMap getEventSlotRanges()getEventSlotCount
Section titled “getEventSlotCount”public int getEventSlotCount()getEventSlot
Section titled “getEventSlot”public int getEventSlot(EventType type, int set, double maxRange)Returns the slot for the given type and set, creating a new one if it does not exist. Updates the maximum range if the new range is larger.
Related Types
Section titled “Related Types”- BuilderSupport — owns block and entity event slot mappers
- SlotMapper — simpler name-to-slot mapper
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.