Give modules per-world state, lifecycle hooks and services: PackWorld with its state store, InvocationContext.world(), ModuleLifecycle, @Service with Providers ALL, FIRST and ONE, ObjectsAt and StructureLocator, and the host's WorldStates, LifecycleRunner and catalog lookups

This commit is contained in:
piexel committed 2026-10-09 14:32:54 +02:00
1 parent ef4b640867
commit b20a3cf719
29 files changed
+1286 -17

No files matched your search

@@ -5,6 +5,7 @@ import com.volmit.mantle.MantleKey;
import com.volmit.mantle.MantleLifetime;
import com.volmit.object.ObjectGeneratorFactory;
import com.volmit.resource.ResourceKind;
import com.volmit.service.Service;
import com.volmit.stage.StageGraph;
import com.volmit.validation.Validator;
@@ -42,4 +43,12 @@ public interface FeatureRegistry {
/** Adds a check the host runs over the whole pack wherever it validates packs. */
void registerValidator(Validator validator);
/** Adds hooks the host calls when it loads the pack and starts or stops a world with it. */
void registerLifecycle(ModuleLifecycle lifecycle);
/** Provides {@code service}, an interface marked {@link Service}, with {@code provider}. A service whose providers
* are {@link com.volmit.service.Providers#ONE} fails the pack load when a second module provides it, naming both.
*/
<S> void registerService(Class<S> service, S provider);
}