Move Registry Events to the mod event bus.

Add infrastructure to allow parallel or synchronous dispatch of
mod events, and pass-through of events to the dispatch system.

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-01-19 23:27:27 -05:00
1 parent ff2e35c243
commit f4d2d1a24b
9 files changed
+162 -88

No files matched your search

@@ -123,10 +123,10 @@ public class ModLoader
}
modList.setLoadedMods(modContainerStream.collect(Collectors.toList()));
dispatchAndHandleError(LifecycleEventProvider.CONSTRUCT);
GameData.fireCreateRegistryEvents();
GameData.fireCreateRegistryEvents(LifecycleEventProvider.CREATE_REGISTRIES, this::dispatchAndHandleError);
ObjectHolderRegistry.findObjectHolders();
CapabilityManager.INSTANCE.injectCapabilities(modList.getAllScanData());
GameData.fireRegistryEvents();
GameData.fireRegistryEvents(rl->true, LifecycleEventProvider.LOAD_REGISTRIES, this::dispatchAndHandleError);
dispatchAndHandleError(LifecycleEventProvider.SETUP);
DistExecutor.runWhenOn(Dist.CLIENT, ModLoader::fireClientEvents);
dispatchAndHandleError(LifecycleEventProvider.SIDED_SETUP);