Class TriggerVolumePlayerStateSystem
- All Implemented Interfaces:
ISystem<EntityStore>, QuerySystem<EntityStore>, TickableSystem<EntityStore>
FlyRule, which needs apply/revert semantics
rather than event cancellation.
Each tick the player's position is queried against the active rules and the desired
movement settings are derived from the player's default settings, so volume edits,
RulesActive toggles, game mode changes (which reset movement settings), teleports,
and respawns all converge on the correct state within a tick. The override is only written
while the rule is active or was active last tick, so the system never fights other movement
code while idle.
-
Nested Class Summary
Nested classes/interfaces inherited from class EntityTickingSystem
EntityTickingSystem.SystemTaskData<ECS_TYPE> -
Field Summary
Fields inherited from interface ISystem
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionTriggerVolumePlayerStateSystem(ResourceType<EntityStore, TriggerVolumeManager> managerResourceType) -
Method Summary
Modifier and TypeMethodDescriptionvoidforgetPlayer(UUID playerUuid) getQuery()voidrevertPlayer(Holder<EntityStore> holder) Reverts an active override for a player leaving the world, so modified movement settings don't leak across world transfers or disconnects.voidtick(float dt, int index, ArchetypeChunk<EntityStore> archetypeChunk, Store<EntityStore> store, CommandBuffer<EntityStore> commandBuffer) Required reading:CommandBufferMethods inherited from class EntityTickingSystem
doTick, isParallel, tickMethods inherited from class ArchetypeTickingSystem
isExplicitQuery, test, tickMethods 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, getGroup, onSystemRegistered, onSystemUnregisteredMethods inherited from interface QuerySystem
getHierarchyScope
-
Constructor Details
-
TriggerVolumePlayerStateSystem
public TriggerVolumePlayerStateSystem(@Nonnull ResourceType<EntityStore, TriggerVolumeManager> managerResourceType)
-
-
Method Details
-
getQuery
-
tick
public void tick(float dt, int index, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer) Description copied from class:EntityTickingSystemRequired reading:CommandBufferCalled once per world tick for each 'entity' inside of an
ArchetypeChunkwith anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.If
EntityTickingSystem.isParallel(int, int)returns true then this is called from a worker thread in the thread pool NOT from the world thread. When working with a parallel system special care must be taken to ensure data that is accessed is done so in a thead safe manor and that all components that have data that is modified are present in theReadWriteArchetypeQuery.getWriteArchetype(). TODO: Expand docs to talk more about how other query types tie into this.To access component data when using this method you should use the following:
var component = archetypeChunk.getComponent(index, componentType);- Specified by:
tickin classEntityTickingSystem<EntityStore>- Parameters:
dt- The delta time in seconds.index- The index of the entity in theArchetypeChunk.
-
revertPlayer
Reverts an active override for a player leaving the world, so modified movement settings don't leak across world transfers or disconnects. -
forgetPlayer
-