-
Notifications
You must be signed in to change notification settings - Fork 0
Service Registry
DarkBladeDev edited this page May 10, 2026
·
1 revision
MultiBlockEngine is built with a Service-Oriented Architecture (SOA). This means that functionality is divided into independent, decoupled services that communicate through well-defined API contracts.
The engine provides a built-in DI system for both internal core components and external addons.
In any class managed by the engine (like a MultiblockAddon or a registered service), you can simply annotate a field to have it automatically populated:
public class MyLogic {
@InjectService
private MultiblockRuntimeService runtime;
@InjectService
private EnergyService energy;
}If you are in a context where injection isn't possible, you can use the AddonAPI:
MultiblockRuntimeService service = AddonAPI.getService(MultiblockRuntimeService.class);| Service | Description |
|---|---|
MultiblockRuntimeService |
Manage active multiblock instances, search, and lifecycle. |
AddonLifecycleService |
Manage addon registration and state. |
HologramService |
Create and manage TextDisplay holograms above multiblocks. |
PersistenceService |
Low-level access to the SQLite/MySQL database. |
MetricsService |
Track performance and usage statistics. |
MessageService |
i18n-aware messaging and formatting. |
These services are provided by the official addons and might not be available if the addon is missing.
| Service | Addon | Description |
|---|---|---|
NetworkService |
mbe-wiring |
Manage topologies, nodes, and graphs. |
EnergyService |
mbe-energy |
Handle power producers, consumers, and storage. |
PanelViewService |
mbe-ui |
Open and manage dynamic UI panels. |
BlueprintService |
mbe-blueprints |
Start/stop visual preview sessions. |
Services go through several phases:
- Register: The service is added to the registry.
- Initialize: Dependencies are injected, but logic shouldn't start yet.
- Start: The engine is ready, and services can start tasks/listeners.
- Stop: Graceful shutdown and data saving.