Class TriggerVolumeWorldGenHandler
- All Implemented Interfaces:
ISystem<EntityStore>, QuerySystem<EntityStore>
VolumeEntry
registrations on the world's TriggerVolumeManager, then removes the transport entity so it does not
persist as an inert holder.
The BuilderTools paste path performs the equivalent conversion via TriggerVolumePasteHandler on
PrefabPlaceEntityEvent, but world-gen prefab placement (HytaleGenerator's PrefabProp) routes
entities through GeneratedEntityChunk and never fires that event, so this handler picks them up when
the chunk loads and the entities arrive in the EntityStore carrying a FromPrefabInstance marker.
Each converted volume gets a fresh random id. Worldgen entities only reach the store on actual generation
(the NEWLY_GENERATED chunk flag is not set on plain disk loads), and TriggerVolumeChunkRegenSystem
wipes the chunk's previous worldgen volumes before that conversion runs, so a regenerated prefab replaces its
volumes rather than stacking duplicates without the ids needing to be stable across regens.
Volumes carrying a groupLinkId are grouped by (prefabInstanceId, linkId): linked volumes
inside one prefab placement merge into one group, while different placements (same prefab type at a different
anchor, or different prefab types entirely) get distinct groups. The mapping uses a deterministic group id so
a prefab spanning multiple chunks resolves to the same group across chunk-load events without paste-style
remap state.
-
Field Summary
Fields inherited from interface ISystem
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionTriggerVolumeWorldGenHandler(ResourceType<EntityStore, TriggerVolumeManager> managerResourceType, ComponentType<EntityStore, TriggerVolume> triggerVolumeComponentType) -
Method Summary
Modifier and TypeMethodDescriptiongetGroup()getQuery()voidonEntityAdded(Ref<EntityStore> ref, AddReason reason, Store<EntityStore> store, CommandBuffer<EntityStore> commandBuffer) Called after an entity has been added to aStoreand has anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.voidonEntityRemove(Ref<EntityStore> ref, RemoveReason reason, Store<EntityStore> store, CommandBuffer<EntityStore> commandBuffer) Called before an entity has been removed from aStoreand has anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.Methods inherited from class System
getComponentRegistrations, getResourceRegistrations, registerResource, registerResourceMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISystem
getDependencies, onSystemRegistered, onSystemUnregisteredMethods inherited from interface QuerySystem
getHierarchyScope, test
-
Constructor Details
-
TriggerVolumeWorldGenHandler
public TriggerVolumeWorldGenHandler(@Nonnull ResourceType<EntityStore, TriggerVolumeManager> managerResourceType, @Nonnull ComponentType<EntityStore, TriggerVolume> triggerVolumeComponentType)
-
-
Method Details
-
getQuery
-
getGroup
- Returns:
- the group this system is a part of or
null. - See Also:
-
onEntityAdded
public void onEntityAdded(@Nonnull Ref<EntityStore> ref, @Nonnull AddReason reason, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer) Description copied from class:RefSystemCalled after an entity has been added to aStoreand has anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.- Specified by:
onEntityAddedin classRefSystem<EntityStore>- Parameters:
ref- The entity reference of the added entity.reason- The reason for the entity being added.store- The store the entity was added to.commandBuffer- The command buffer to execute tasks. Note: The command buffer tasks are executed after all systems have processed the entity add.
-
onEntityRemove
public void onEntityRemove(@Nonnull Ref<EntityStore> ref, @Nonnull RemoveReason reason, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer) Description copied from class:RefSystemCalled before an entity has been removed from aStoreand has anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.- Specified by:
onEntityRemovein classRefSystem<EntityStore>- Parameters:
ref- The entity reference of the removed entity.reason- The reason for the entity being removed.store- The store the entity is being removed from.commandBuffer- The command buffer to execute tasks. Note: The command buffer tasks are executed after all systems have processed the entity remove.
-