Skip to content

Commit

Permalink
Fix registries being created too late
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 22, 2024
1 parent b576b49 commit 31e7780
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/cyclops/integratedrest/IntegratedRest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public IntegratedRest(IEventBus modEventBus) {
super(Reference.MOD_ID, (instance) -> _instance = instance, modEventBus);
server = new HttpServer();

// Registries
getRegistryManager().addRegistry(IRequestHandlerRegistry.class, RequestHandlerRegistry.getInstance());
getRegistryManager().addRegistry(IValueTypeJsonHandlerRegistry.class, ValueTypeJsonHandlerRegistry.getInstance());

NeoForge.EVENT_BUS.addListener(this::onApiServerStarted);
NeoForge.EVENT_BUS.addListener(this::onApiServerStopping);
modEventBus.addListener(this::onSetup);
Expand All @@ -61,10 +65,6 @@ public IntegratedRest(IEventBus modEventBus) {
protected void setup(FMLCommonSetupEvent event) {
super.setup(event);

// Registries
getRegistryManager().addRegistry(IRequestHandlerRegistry.class, RequestHandlerRegistry.getInstance());
getRegistryManager().addRegistry(IValueTypeJsonHandlerRegistry.class, ValueTypeJsonHandlerRegistry.getInstance());

if (MinecraftHelpers.isClientSide()) {
HttpVariableModelProviders.load();
}
Expand Down

0 comments on commit 31e7780

Please sign in to comment.