Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- register(String, VolumeEntry)
- unregister(String)
- updateTrackingState(VolumeEntry)
- getActiveVolumes()
- hasEntityTargetVolumes()
- renameVolume(String, String)
- removeWorldGenVolumesInChunk(long)
- removeAllVolumes()
- getVolume(String)
- getVolumes()
- hasVolumes()
- getVolumesMap()
- hasVolume(String)
- markSpatialDirty()
- hasActiveRule(Vector3d, Class)
- getActiveRules(Vector3d, Class)
- getActiveRulesWithVolume(Vector3d, Class)
- getSpatialIndex()
- getDelayedEffectScheduler()
- getNowNanos()
- stampClock(Instant)
- setWorld(World)
- getWorld()
- registerGroup(String, GroupEntry)
- makeUniqueVolumeName(String, String)
- makeUniqueGroupName(String, String)
- unregisterGroup(String)
- getGroup(String)
- hasGroup(String)
- clearPrefabGroupLinkRemap()
- ensureGroupForPrefabLink(String, VolumeEntry, String)
- upsertGroupForPrefabLink(String, TriggerVolumeGroup, String, Vector3d, float)
- ensureWorldGenGroup(int, String, VolumeEntry, String)
- upsertWorldGenGroup(int, String, TriggerVolumeGroup, String, Vector3d, float)
- generateUniqueVolumeId()
- getGroupsMap()
- getGroupMembers(String)
- getVolumesByTag(int)
- getGroupsByTag(int)
- setTag(String, String, String, Ref, UUID)
- removeTag(String, String, Ref, UUID)
- removeTag(String, String, String, Ref, UUID)
- enqueueBlockEvent(TriggerEventType, Ref, UUID, Vector3d, String)
- enqueueBlockEvent(TriggerEventType, Ref, UUID, Vector3d, String, InteractionType)
- enqueueEntityUseEvent(Ref, UUID, Vector3d, String, InteractionType)
- enqueueEnvironmentBlockEvent(TriggerEventType, Vector3d, String)
- enqueuePositionalEvent(TriggerEventType, Ref, UUID, Vector3d)
- enqueueVolumeCreateEvent(VolumeEntry, Ref, UUID)
- enqueueVolumeEvent(TriggerEventType, Ref, UUID, String, String, String)
- enqueueVolumeEvent(TriggerEventType, Ref, UUID, String, List)
- enqueueVolumeEvent(TriggerEventType, Ref, UUID, String, List, Vector3d, String)
- pollPendingEvent()
- hasPendingEvents()
- isViewing(UUID)
- isViewing(UUID, TriggerVolumeManager.ViewSource)
- peekViewerSources(UUID)
- addViewer(UUID, TriggerVolumeManager.ViewSource)
- removeViewer(UUID, TriggerVolumeManager.ViewSource)
- setPlayerSelection(UUID, String)
- getPlayerSelection(UUID)
- setSelectionObserver(UUID, TriggerVolumeManager.SelectionObserver)
- clearSelectionObserver(UUID, TriggerVolumeManager.SelectionObserver)
- setVolumeUpdateObserver(UUID, TriggerVolumeManager.VolumeUpdateObserver)
- clearVolumeUpdateObserver(UUID, TriggerVolumeManager.VolumeUpdateObserver)
- notifyViewers()
- getViewerCount()
- getViewerUuids()
- clearViewers()
- notifyViewersAdd(VolumeEntry)
- notifyViewersRemove(String)
- notifyViewersLegacyVolumeSkipped()
- sendVolumeDisplay(PlayerRef)
- buildDisplayEntry(VolumeEntry)
- markClientRuleVolumesDirty()
- flushTickSuppressionIfDirty(TickSuppressionRegistry)
- flushClientRuleVolumesIfDirty()
- broadcastClientRuleVolumes()
- sendClientRuleVolumes(PlayerRef)
- clone()
Class TriggerVolumeManager
java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.manager.TriggerVolumeManager
- All Implemented Interfaces:
Resource<EntityStore>, Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTriggerVolumeManager.ActiveRule<T extends TriggerRule>A rule active at a queried position together with the in-range volume it was found on.static final recordstatic interfacestatic enumstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<TriggerVolumeManager> static final UUIDThe actor UUID used for environment-sourced events that have no instigating entity, so the cooldown machinery (keyed by actor UUID) still functions.Fields inherited from interface Resource
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewer(UUID playerUuid, TriggerVolumeManager.ViewSource source) voidConverts server-side volume geometry into the compact client debug-display packet shape.voidvoidclearSelectionObserver(UUID playerUuid, TriggerVolumeManager.SelectionObserver observer) voidvoidclearVolumeUpdateObserver(UUID playerUuid, TriggerVolumeManager.VolumeUpdateObserver observer) clone()voidenqueueBlockEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, org.joml.Vector3d blockPosition, String blockId) voidenqueueBlockEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, org.joml.Vector3d blockPosition, String blockId, InteractionType interactionType) voidenqueueEntityUseEvent(Ref<EntityStore> actorRef, UUID actorUuid, org.joml.Vector3d position, String blockId, InteractionType interactionType) Enqueues aTriggerEventType.BLOCK_USEDevent for an entity interaction (pressing use on an entity rather than a block), dispatched positionally to volumes containing the entity.voidenqueueEnvironmentBlockEvent(TriggerEventType eventType, org.joml.Vector3d blockPosition, String blockId) Enqueues a block event with no instigating entity (e.g. fire burning a block or an unattributed explosion).voidenqueuePositionalEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, org.joml.Vector3d position) Enqueues a positional event at an arbitrary world position (used by death events).voidenqueueVolumeCreateEvent(VolumeEntry entry, Ref<EntityStore> actorRef, UUID actorUuid) Enqueues aTriggerEventType.VOLUME_CREATEevent scoped to the just-created volume.voidenqueueVolumeEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, String volumeId, String tagKey, String tagValue) voidenqueueVolumeEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, String volumeId, List<SignalTag> signalTags) voidenqueueVolumeEvent(TriggerEventType eventType, Ref<EntityStore> actorRef, UUID actorUuid, String volumeId, List<SignalTag> signalTags, org.joml.Vector3d blockPosition, String blockId) ensureGroupForPrefabLink(String groupLinkId, VolumeEntry memberVolume, String worldName) Returns a new world group id for this prefab link id, creatingGroupEntryon first use.ensureWorldGenGroup(int prefabInstanceId, String linkId, VolumeEntry memberVolume, String worldName) Returns a deterministic world group id for a world-gen-placed volume keyed by(prefabInstanceId, linkId).voidBroadcasts a fresh snapshot to all players once if it changed; called once per world tick.voidRebuilds the NoTick suppression snapshot into the world's registry once if it changed.<T extends TriggerRule>
List<T> getActiveRules(org.joml.Vector3d worldPos, Class<T> ruleClass) Collects all rule instances of the given class active atworldPos, including group-inherited rules.<T extends TriggerRule>
List<TriggerVolumeManager.ActiveRule<T>> getActiveRulesWithVolume(org.joml.Vector3d worldPos, Class<T> ruleClass) LikegetActiveRules(Vector3d, Class), but pairs each rule with the volume it came from (the in-range member volume for group-inherited rules).getGroupMembers(String groupId) getGroupsByTag(int tagIndex) longThe world alive time every volume timer is measured against: delays, intervals, cooldowns and animation gates.getPlayerSelection(UUID playerUuid) intgetVolumesByTag(int tagIndex) getWorld()booleanhasActiveRule(org.joml.Vector3d worldPos, Class<? extends TriggerRule> ruleClass) Returns whether any enabled volume with active rules containsworldPosand carries a rule of the given class, either directly or inherited from its group.booleanWhether any enabled volume targets a non-player entity type, gating the per-tick scan of the non-player spatial structure.booleanbooleanbooleanbooleanCheap check (no view allocation) for whether any volume exists, for gating hot event paths.booleanbooleanisViewing(UUID playerUuid, TriggerVolumeManager.ViewSource source) makeUniqueGroupName(String desired, String excludeId) Group counterpart ofmakeUniqueVolumeName(String, String); disambiguates among group display names.makeUniqueVolumeName(String desired, String excludeId) Resolves a unique display name for a volume from the user-supplieddesiredvalue: a blank value yields a fresh default name, and a value already used by another volume is disambiguated with the smallest numeric suffix (e.g.voidMarks the predicted rule-volume snapshot stale so it is re-broadcast on the next flush.voidSignals that derived state may be stale after an in-place edit that does not flow through theVolumeEntrymutators (e.g. a target-type set edited viagetTargetTypes()).voidvoidvoidvoidnotifyViewersRemove(String volumeId) peekViewerSources(UUID playerUuid) voidregister(String id, VolumeEntry entry) voidregisterGroup(String id, GroupEntry entry) intDrops every volume and group in the world - tool-placed and worldgen alike.booleanbooleanvoidremoveViewer(UUID playerUuid, TriggerVolumeManager.ViewSource source) voidremoveWorldGenVolumesInChunk(long chunkIndex) Drops everyworldgen-taggedentry whose anchor position lies in the given chunk, plus any group it leaves empty.renameVolume(String oldId, String newId) voidsendClientRuleVolumes(PlayerRef playerRef) voidsendVolumeDisplay(PlayerRef playerRef) voidsetPlayerSelection(UUID playerUuid, String volumeId) voidsetSelectionObserver(UUID playerUuid, TriggerVolumeManager.SelectionObserver observer) booleanvoidsetVolumeUpdateObserver(UUID playerUuid, TriggerVolumeManager.VolumeUpdateObserver observer) voidlongstampClock(Instant now) Stamps the clock for this tick and returns the value.voidunregister(String id) voidvoidupdateTrackingState(VolumeEntry entry) Adds the volume to the active set while it tracks entities, removes it otherwise.upsertGroupForPrefabLink(String groupLinkId, TriggerVolumeGroup groupComponent, String worldName, org.joml.Vector3d origin, float yawRadians) upsertWorldGenGroup(int prefabInstanceId, String linkId, TriggerVolumeGroup groupComponent, String worldName, org.joml.Vector3d origin, float yawRadians)
-
Field Details
-
ENVIRONMENT_ACTOR_UUID
The actor UUID used for environment-sourced events that have no instigating entity, so the cooldown machinery (keyed by actor UUID) still functions. All such events share this bucket. -
CODEC
-
-
Constructor Details
-
TriggerVolumeManager
public TriggerVolumeManager()
-
-
Method Details
-
register
-
unregister
-
updateTrackingState
Adds the volume to the active set while it tracks entities, removes it otherwise. -
getActiveVolumes
-
hasEntityTargetVolumes
public boolean hasEntityTargetVolumes()Whether any enabled volume targets a non-player entity type, gating the per-tick scan of the non-player spatial structure. Players are always scanned. Recomputed lazily after any change that could affect it, so the common no-NPC-volume case skips the entity scan entirely. -
renameVolume
-
removeWorldGenVolumesInChunk
public void removeWorldGenVolumesInChunk(long chunkIndex) Drops everyworldgen-taggedentry whose anchor position lies in the given chunk, plus any group it leaves empty. Called from the chunk-store side when a worldgen chunk is freshly added (regen via viewport //chunk regenerate//worldgen reload) so the new generation can re-register its volumes without piling up onto the previous run's entries. -
removeAllVolumes
public int removeAllVolumes()Drops every volume and group in the world - tool-placed and worldgen alike. Called whenworldgen reload --clearwipes the world so nothing stale lingers; loaded chunks re-register their worldgen volumes as they regenerate. -
getVolume
-
getVolumes
-
hasVolumes
public boolean hasVolumes()Cheap check (no view allocation) for whether any volume exists, for gating hot event paths. -
getVolumesMap
-
hasVolume
-
markSpatialDirty
public void markSpatialDirty()Signals that derived state may be stale after an in-place edit that does not flow through theVolumeEntrymutators (e.g. a target-type set edited viagetTargetTypes()). Position/shape/enabled changes notify the index directly, so this only refreshes the entity-target gate. -
hasActiveRule
public boolean hasActiveRule(@Nonnull org.joml.Vector3d worldPos, @Nonnull Class<? extends TriggerRule> ruleClass) Returns whether any enabled volume with active rules containsworldPosand carries a rule of the given class, either directly or inherited from its group. Used by rule enforcement systems at cancellable event hooks. -
getActiveRules
@Nonnull public <T extends TriggerRule> List<T> getActiveRules(@Nonnull org.joml.Vector3d worldPos, @Nonnull Class<T> ruleClass) Collects all rule instances of the given class active atworldPos, including group-inherited rules. Lets enforcement systems for configurable rule types read their rule's fields. -
getActiveRulesWithVolume
@Nonnull public <T extends TriggerRule> List<TriggerVolumeManager.ActiveRule<T>> getActiveRulesWithVolume(@Nonnull org.joml.Vector3d worldPos, @Nonnull Class<T> ruleClass) LikegetActiveRules(Vector3d, Class), but pairs each rule with the volume it came from (the in-range member volume for group-inherited rules). Enforcement systems use this when they need to act on the owning volume, e.g. to send a signal back to it. -
getSpatialIndex
-
getDelayedEffectScheduler
-
getNowNanos
public long getNowNanos()The world alive time every volume timer is measured against: delays, intervals, cooldowns and animation gates. This isTimeResourceas nanoseconds, so it stops while the world is paused and follows the world time dilation modifier. Volume expiry reads the same resource.The value is stamped once per tick, so every timer compared within a tick sees the same instant.
-
stampClock
Stamps the clock for this tick and returns the value. Called byTriggerVolumeTickingSystembefore anything reads the clock. -
setWorld
-
getWorld
-
registerGroup
-
makeUniqueVolumeName
Resolves a unique display name for a volume from the user-supplieddesiredvalue: a blank value yields a fresh default name, and a value already used by another volume is disambiguated with the smallest numeric suffix (e.g.Door,Door (2),Door (3)).excludeIdis the volume being renamed, so keeping its own name is a no-op. -
makeUniqueGroupName
Group counterpart ofmakeUniqueVolumeName(String, String); disambiguates among group display names. -
unregisterGroup
-
getGroup
-
hasGroup
-
clearPrefabGroupLinkRemap
public void clearPrefabGroupLinkRemap() -
ensureGroupForPrefabLink
@Nonnull public String ensureGroupForPrefabLink(@Nonnull String groupLinkId, @Nonnull VolumeEntry memberVolume, @Nonnull String worldName) Returns a new world group id for this prefab link id, creatingGroupEntryon first use. -
upsertGroupForPrefabLink
@Nonnull public String upsertGroupForPrefabLink(@Nonnull String groupLinkId, @Nonnull TriggerVolumeGroup groupComponent, @Nonnull String worldName, @Nonnull org.joml.Vector3d origin, float yawRadians) -
ensureWorldGenGroup
@Nullable public String ensureWorldGenGroup(int prefabInstanceId, @Nonnull String linkId, @Nonnull VolumeEntry memberVolume, @Nonnull String worldName) Returns a deterministic world group id for a world-gen-placed volume keyed by(prefabInstanceId, linkId). Created on first call; subsequent calls (e.g. from the same prefab spanning multiple chunks) find and reuse it. UnlikeensureGroupForPrefabLink(String, VolumeEntry, String)this keeps no remap state on the manager: the id is recoverable from its inputs, andgroupsis the only source of truth.- Returns:
- the resolved group id, or
nulliflinkIdsanitizes to empty (caller should skip group assignment).
-
upsertWorldGenGroup
@Nullable public String upsertWorldGenGroup(int prefabInstanceId, @Nonnull String linkId, @Nonnull TriggerVolumeGroup groupComponent, @Nonnull String worldName, @Nonnull org.joml.Vector3d origin, float yawRadians) -
generateUniqueVolumeId
Generates a unique volume id using thetv_prefix; loops untilhasVolume(String)returnsfalse. Shared by all paths that programmatically register volumes (BuilderTools paste, world-generation prefab placement). -
getGroupsMap
-
getGroupMembers
-
getVolumesByTag
-
getGroupsByTag
-
setTag
-
removeTag
public boolean removeTag(@Nonnull String volumeId, @Nonnull String key, @Nullable Ref<EntityStore> actorRef, @Nonnull UUID actorUuid) -
removeTag
-
enqueueBlockEvent
public void enqueueBlockEvent(@Nonnull TriggerEventType eventType, @Nonnull Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull org.joml.Vector3d blockPosition, @Nonnull String blockId) -
enqueueBlockEvent
public void enqueueBlockEvent(@Nonnull TriggerEventType eventType, @Nonnull Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull org.joml.Vector3d blockPosition, @Nonnull String blockId, @Nullable InteractionType interactionType) -
enqueueEntityUseEvent
public void enqueueEntityUseEvent(@Nonnull Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull org.joml.Vector3d position, @Nullable String blockId, @Nullable InteractionType interactionType) Enqueues aTriggerEventType.BLOCK_USEDevent for an entity interaction (pressing use on an entity rather than a block), dispatched positionally to volumes containing the entity.blockIdcarries the entity's type id when one is cheaply available (e.g. an item entity's item id) and is null otherwise, so a block-type condition simply does not match for untyped entity uses. -
enqueueEnvironmentBlockEvent
public void enqueueEnvironmentBlockEvent(@Nonnull TriggerEventType eventType, @Nonnull org.joml.Vector3d blockPosition, @Nonnull String blockId) Enqueues a block event with no instigating entity (e.g. fire burning a block or an unattributed explosion). The cooldown bucket is keyed byENVIRONMENT_ACTOR_UUID, so all environment breaks share one cooldown per volume, and effects that require a player actor no-op for these events. -
enqueuePositionalEvent
public void enqueuePositionalEvent(@Nonnull TriggerEventType eventType, @Nonnull Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull org.joml.Vector3d position) Enqueues a positional event at an arbitrary world position (used by death events). The event is dispatched to every enabled volume whose shape contains the position, mirroring the block-event path but without a block id. -
enqueueVolumeCreateEvent
public void enqueueVolumeCreateEvent(@Nonnull VolumeEntry entry, @Nullable Ref<EntityStore> actorRef, @Nonnull UUID actorUuid) Enqueues aTriggerEventType.VOLUME_CREATEevent scoped to the just-created volume. The actor is the entity that triggered creation when one exists (e.g. the player or shooter behind a spawn interaction); passENVIRONMENT_ACTOR_UUIDwith a null ref for unattributed creations such as world generation, in which case effects needing an actor no-op. -
enqueueVolumeEvent
public void enqueueVolumeEvent(@Nonnull TriggerEventType eventType, @Nonnull Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull String volumeId, @Nullable String tagKey, @Nullable String tagValue) -
enqueueVolumeEvent
public void enqueueVolumeEvent(@Nonnull TriggerEventType eventType, @Nullable Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull String volumeId, @Nonnull List<SignalTag> signalTags) -
enqueueVolumeEvent
public void enqueueVolumeEvent(@Nonnull TriggerEventType eventType, @Nullable Ref<EntityStore> actorRef, @Nonnull UUID actorUuid, @Nonnull String volumeId, @Nonnull List<SignalTag> signalTags, @Nullable org.joml.Vector3d blockPosition, @Nullable String blockId) -
pollPendingEvent
-
hasPendingEvents
public boolean hasPendingEvents() -
isViewing
-
isViewing
-
peekViewerSources
@Nullable public EnumSet<TriggerVolumeManager.ViewSource> peekViewerSources(@Nonnull UUID playerUuid) -
addViewer
-
removeViewer
-
setPlayerSelection
-
getPlayerSelection
-
setSelectionObserver
public void setSelectionObserver(@Nonnull UUID playerUuid, @Nonnull TriggerVolumeManager.SelectionObserver observer) -
clearSelectionObserver
public void clearSelectionObserver(@Nonnull UUID playerUuid, @Nonnull TriggerVolumeManager.SelectionObserver observer) -
setVolumeUpdateObserver
public void setVolumeUpdateObserver(@Nonnull UUID playerUuid, @Nonnull TriggerVolumeManager.VolumeUpdateObserver observer) -
clearVolumeUpdateObserver
public void clearVolumeUpdateObserver(@Nonnull UUID playerUuid, @Nonnull TriggerVolumeManager.VolumeUpdateObserver observer) -
notifyViewers
public void notifyViewers() -
getViewerCount
public int getViewerCount() -
getViewerUuids
-
clearViewers
public void clearViewers() -
notifyViewersAdd
-
notifyViewersRemove
-
notifyViewersLegacyVolumeSkipped
public void notifyViewersLegacyVolumeSkipped() -
sendVolumeDisplay
-
buildDisplayEntry
Converts server-side volume geometry into the compact client debug-display packet shape. Box and cylinder entries use their center point for display, while unknown shapes fall back to a sphere based on the shape's display bounding radius. -
markClientRuleVolumesDirty
public void markClientRuleVolumesDirty()Marks the predicted rule-volume snapshot stale so it is re-broadcast on the next flush. Also marks the NoTick suppression snapshot stale, since the same volume/rule/group mutations that change predicted rule volumes can change which volumes suppress block ticking. -
flushTickSuppressionIfDirty
Rebuilds the NoTick suppression snapshot into the world's registry once if it changed. -
flushClientRuleVolumesIfDirty
public void flushClientRuleVolumesIfDirty()Broadcasts a fresh snapshot to all players once if it changed; called once per world tick. -
broadcastClientRuleVolumes
public void broadcastClientRuleVolumes() -
sendClientRuleVolumes
-
clone
- Specified by:
clonein interfaceResource<EntityStore>- Returns:
- a clone instance of the original resource instance.
-