-
Notifications
You must be signed in to change notification settings - Fork 0
What is TemporalEngine
This page explains the architecture of the Temporal Engine and how to configure its execution layers.
TemporalEngine is the main entry point responsible for bootstrapping the Temporal API and orchestrating the execution of all engine layers.
EngineLayer is a single, ordered processing stage that performs a specific category of tasks during mod initialization.
LayerContainer is a registry that stores, orders, and provides access to all active EngineLayer instances.
The InitializationLayer prepares the engine context, resolves the mod class, and registers external sources such as the IEventBus and ModContainer.
The RegistryLayer handles registration of objects (items, blocks, etc.) using factories.
The MetadataLayer processes metadata-related annotations (f.e, datagen annotations).
The ConfigLayer manages NeoForge Config-related processing.
The EventLayer connects Temporal API logic to the NeoForge Event Bus and registers event-driven behaviors.
The FinalizationLayer performs cleanup and final validation after all other layers have been processed.
The simplest and recommended way to start the engine is:
TemporalEngine.run(ExampleMod.class, modEventBus, modContainer);This method:
- prints the Temporal API banner
- initializes logging and mod context
- builds and executes the default layer pipeline
Internally, TemporalEngine.run(...) uses the following configuration:
TemporalEngine.defaultBuilder(modClass, eventBus, modContainer)Which registers layers in this order:
- InitializationLayer
- RegistryLayer
- MetadataLayer
- ConfigLayer
- EventLayer
- FinalizationLayer
This order defines the exact execution sequence.
To customize the engine, use an empty builder:
EngineBuilder builder = TemporalEngine.emptyBuilder();You may then selectively configure layers.
To remove a layer from the pipeline:
builder.disableLayer(EventLayer.class);This completely excludes the layer from execution.
You can manually register your own layer:
builder.addLayer(new CustomEngineLayer());Custom layers must extend EngineLayer and implement task processing logic.
Each layer is processed sequentially using:
engineLayer.processAllTasks();The engine logs:
- when a layer starts processing
- when it finishes processing
This ensures deterministic and traceable execution.
-
LayerContaineris a global singleton - layers are stored in insertion order
- layers can be retrieved by index or class
- duplicate layer classes are not automatically prevented
You should customize TemporalEngine if:
- you want to disable unnecessary layers
- you need a custom processing stage
- you require strict control over execution order
For most mods, the default configuration is sufficient.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples