From 7ee6ac527f49a613d582f30ffde1f3fae746376d Mon Sep 17 00:00:00 2001 From: CammiePone Date: Fri, 8 Nov 2024 13:35:03 -0800 Subject: [PATCH] i never claimed to be smart. it works now --- .../dev/upcraft/sparkweave/fabric/entrypoint/Main.java | 3 ++- .../dev/upcraft/sparkweave/neoforge/entrypoint/Main.java | 3 +++ .../upcraft/sparkweave/neoforge/event/ForgeBusEvents.java | 7 ------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Fabric/src/main/java/dev/upcraft/sparkweave/fabric/entrypoint/Main.java b/Fabric/src/main/java/dev/upcraft/sparkweave/fabric/entrypoint/Main.java index d8133b3..497fe8d 100644 --- a/Fabric/src/main/java/dev/upcraft/sparkweave/fabric/entrypoint/Main.java +++ b/Fabric/src/main/java/dev/upcraft/sparkweave/fabric/entrypoint/Main.java @@ -33,13 +33,14 @@ public void onInitialize() { ServerTickEvents.START_SERVER_TICK.register(server -> ScheduledTaskQueue.onServerTick()); CommandRegistrationCallback.EVENT.register((dispatcher, buildContext, environment) -> CommandEvents.REGISTER.invoker().registerCommands(dispatcher, buildContext, environment)); - CustomLecternMenuEvent.EVENT.invoker().registerLecternMenus(new CustomLecternMenuEvent()); var service = RegistryService.get(); SparkweaveCommandArgumentTypes.ARGUMENT_TYPES.accept(service); EntrypointHelper.fireEntrypoints(MainEntryPoint.class, MainEntryPoint::onInitialize); + CustomLecternMenuEvent.EVENT.invoker().registerLecternMenus(new CustomLecternMenuEvent()); + SparkweaveLogging.getLogger().debug("System initialized!"); } } diff --git a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/entrypoint/Main.java b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/entrypoint/Main.java index 63ffdf1..1640d9d 100644 --- a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/entrypoint/Main.java +++ b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/entrypoint/Main.java @@ -5,6 +5,7 @@ import dev.upcraft.sparkweave.api.entrypoint.ClientEntryPoint; import dev.upcraft.sparkweave.api.entrypoint.DedicatedServerEntryPoint; import dev.upcraft.sparkweave.api.entrypoint.MainEntryPoint; +import dev.upcraft.sparkweave.api.event.CustomLecternMenuEvent; import dev.upcraft.sparkweave.api.platform.services.RegistryService; import dev.upcraft.sparkweave.api.registry.block.BlockItemProvider; import dev.upcraft.sparkweave.entrypoint.EntrypointHelper; @@ -30,6 +31,8 @@ public Main(IEventBus bus) { EntrypointHelper.fireEntrypoints(MainEntryPoint.class, MainEntryPoint::onInitialize); + CustomLecternMenuEvent.EVENT.invoker().registerLecternMenus(new CustomLecternMenuEvent()); + switch (FMLEnvironment.dist) { case CLIENT -> EntrypointHelper.fireEntrypoints(ClientEntryPoint.class, ClientEntryPoint::onInitializeClient); diff --git a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/event/ForgeBusEvents.java b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/event/ForgeBusEvents.java index a1acc22..e22df8d 100644 --- a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/event/ForgeBusEvents.java +++ b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/event/ForgeBusEvents.java @@ -2,11 +2,9 @@ import dev.upcraft.sparkweave.SparkweaveMod; import dev.upcraft.sparkweave.api.event.CommandEvents; -import dev.upcraft.sparkweave.api.event.CustomLecternMenuEvent; import dev.upcraft.sparkweave.scheduler.ScheduledTaskQueue; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; import net.neoforged.neoforge.event.RegisterCommandsEvent; import net.neoforged.neoforge.event.server.ServerStartingEvent; import net.neoforged.neoforge.event.server.ServerStoppedEvent; @@ -34,9 +32,4 @@ public static void onServerTick(ServerTickEvent.Pre event) { public static void onRegisterCommands(RegisterCommandsEvent event) { CommandEvents.REGISTER.invoker().registerCommands(event.getDispatcher(), event.getBuildContext(), event.getCommandSelection()); } - - @SubscribeEvent - public static void onRegisterMenus(RegisterMenuScreensEvent event) { - CustomLecternMenuEvent.EVENT.invoker().registerLecternMenus(new CustomLecternMenuEvent()); - } }