-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
DarkBladeDev edited this page Feb 21, 2026
·
2 revisions
-
EventLoader: carga
events/*.yml→EventDefinition. - EventEngine: motor principal; registra defaults, triggers, y administra runtimes.
-
RuntimeScheduler: ejecuta
EventRuntimetick a tick. -
ChunkEventLockManager: locks por
ChunkPospara evitar superposiciones. -
TerritorialTriggerDispatcher: resuelve target y llama a
startEvent. -
PersistenceManager: snapshot/restore de runtimes (
runtime.json).
- Se carga
events/*.yml. - Se calculan definiciones globales de variables (
scope: global) y se inicializan. - Se registran triggers por evento.
- Un trigger dispara y produce un
TriggerContext. - El dispatcher resuelve el chunk objetivo:
- Si
TriggerContexttraelocation, se usa el chunk de esa ubicación. - Si no trae ubicación, se usa
event.target.strategy(por defectorandom_loaded_chunk).
- Si
-
startEventcrea unEventRuntime, inicializa variables locales, compila el flow, y toma locks por scope. - El scheduler ejecuta el plan (acciones, delays, loops, async).
Los locks se manejan con un mapa ChunkPos -> EventRuntime.
- Si un chunk objetivo está ocupado,
startEventretornaCHUNK_OCCUPIED. - El scope por defecto (
chunk_radius) define qué conjunto de chunks se intenta bloquear.
CEE mantiene un set de participantes (UUIDs) por runtime.
- Se actualiza mediante un listener global que, al cambiar de chunk, asigna al jugador como participante si su chunk actual tiene runtime.
- Acciones como
send_participantsiteran sobre ese set.
El motor expone una API (interfaces) para registrar:
- actions
- conditions
- triggers
- scopes
- chunk strategies
CustomEventEngine • Paper/Spigot API 1.20+ • Java 21