Skip to content

Commit

Permalink
i never claimed to be smart. it works now
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Nov 8, 2024
1 parent 7c11eba commit 7ee6ac5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 7ee6ac5

Please sign in to comment.