-
Notifications
You must be signed in to change notification settings - Fork 0
Config Layer
The Config Layer is responsible for NeoForge configuration support for a mod.
If earlier layers handle:
- structure (Initialization),
- registration (Registry),
- semantics (Metadata),
then the Config Layer answers:
“How does NeoForge Config become visible, usable, and integrated?”
This layer is the bridge between configuration metadata and user-facing configuration UX/UI.
The Config Layer is responsible for:
- Executing configuration-related annotation processors
- Registering configuration screens / UI
- Exposing configuration through NeoForge extension points
- Allowing mods to extend or replace config presentation logic
public class ConfigLayer implements EngineLayerprivate static final AnnotationProcessor CONFIG_PROCESSOR = new ConfigAnnotationProcessor();This processor is always executed, regardless of configuration.
Interpretation: Configuration annotations are mandatory metadata - they are not optional or lazy.
@Override
public void processAllTasks()- Run configuration annotation processing
- Run default config showcasers
- Run dynamically injected config showcasers
CONFIG_PROCESSOR.process();This step:
- Interprets configuration-related annotations
- Prepares config structures for later usage
This relies on work done in the Metadata Layer.
configShowcasers.forEach(ConfigShowcaser::showcase);These are provided by the framework.
objectPool.getAll(ConfigShowcaser.class)This allows:
- Mods to inject custom config UIs
- Libraries to extend configuration behavior
- Replacement without forking core code
private static final List<ConfigShowcaser> DEFAULT_CONFIG_SHOWCASERS = List.of(new SimpleConfigShowcaser());By default, one config presentation mechanism is registered.
this.engineBuilder.processLayer(this.configLayer);Like other layers, ConfigLayer executes immediately when configured.
This ensures:
- Config screens are available early
- UI is registered before game load completes
A ConfigShowcaser is responsible for:
Making configuration visible to the user
It does not:
- Define config values
- Parse annotations
- Store config state
It only exposes configuration.
public class SimpleConfigShowcaser implements ConfigShowcaserModContainer modContainer = InjectionPool.getFromInstance(ModContainer.class);
modContainer.registerExtensionPoint(
IConfigScreenFactory.class,
ConfigurationScreen::new
);This registers a NeoForge configuration screen.
- The mod gains a config screen in the Mods UI
- The screen is generated via
ConfigurationScreen - NeoForge handles lifecycle and rendering
Interpretation: Temporal API does not replace NeoForge config — it integrates with it.
You can provide your own implementation:
public class MyConfigShowcaser implements ConfigShowcaser {
@Override
public void showcase() {
// custom UI / logic
}
}Register it via:
- InjectionPool
- or ConfigLayerBuilder
.configureConfigLayer()
.configShowcasers(List.of(new MyConfigShowcaser()))
.and()This fully replaces the default behavior.
The Config Layer:
- Registers configuration UI
- Integrates with NeoForge Config
- Supports extension and override
It is the presentation layer of configuration in Temporal API.
🚀 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