Skip to content

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.

ParameterDescription
EventTypeThe enum type representing event categories (e.g., BlockEventType, EntityEventType).
FieldTypeDescription
eventSetsMap<EventType, IntSet>Set IDs registered per event type.
eventSlotMappingsMap<EventType, Int2IntMap>Set ID to slot index mapping per event type.
eventSlotRangesInt2DoubleMapMaximum observation range per slot.
nextEventSlotintCounter for allocating new slots.
public EventSlotMapper(Class<EventType> classType, EventType[] types)
@Nonnull
public Map<EventType, IntSet> getEventSets()
@Nonnull
public Map<EventType, Int2IntMap> getEventSlotMappings()
@Nonnull
public Int2DoubleMap getEventSlotRanges()
public int getEventSlotCount()
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.

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