From aba93090b762f8b7f67321253f7982795cdb7398 Mon Sep 17 00:00:00 2001 From: Type-32 <87076491+Type-32@users.noreply.github.com> Date: Wed, 5 Jun 2024 00:21:45 +0800 Subject: [PATCH] Tryna fix the server error thingy Signed-off-by: Type-32 <87076491+Type-32@users.noreply.github.com> --- .../precisemanufacturing/Main.java | 17 ----------------- .../foundation/ModContainerScreens.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 src/main/java/cn/crtlprototypestudios/precisemanufacturing/foundation/ModContainerScreens.java diff --git a/src/main/java/cn/crtlprototypestudios/precisemanufacturing/Main.java b/src/main/java/cn/crtlprototypestudios/precisemanufacturing/Main.java index 6c44efd..c2003be 100644 --- a/src/main/java/cn/crtlprototypestudios/precisemanufacturing/Main.java +++ b/src/main/java/cn/crtlprototypestudios/precisemanufacturing/Main.java @@ -77,7 +77,6 @@ private void processIMC(final InterModProcessEvent event) { private void clientSetup(final FMLClientSetupEvent event) { // event.enqueueWork(() -> ); - MenuScreens.register(ModContainers.DECOMPONENTALIZER.get(), DecomponentalizerScreen::new); ItemBlockRenderTypes.setRenderLayer(ModBlocks.DECOMPONENTALIZER.get(), RenderType.translucent()); } @@ -87,20 +86,4 @@ public void onServerStarting(ServerStartingEvent event) { // Do something when the server starts LOGGER.info("HELLO from server starting"); } - - // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD - // Event bus for receiving Registry Events) - @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) - public static class RegistryEvents { -// @SubscribeEvent -// public static void onBlocksRegistry(final RegistryEvent.Register blockRegistryEvent) { -// // Register a new block here -// LOGGER.info("HELLO from Register Block"); -// } -// -// @SubscribeEvent -// public static void onItemsRegistry(final RegistryEvent.Register itemRegistryEvent) { -// LOGGER.info("M4A1 registry size {}; cast {}; blueprint {}", ModItems.M4A1.registry.size(), ModItems.M4A1.castsRegistry.size(), ModItems.M4A1.blueprintsRegistry.size()); -// } - } } diff --git a/src/main/java/cn/crtlprototypestudios/precisemanufacturing/foundation/ModContainerScreens.java b/src/main/java/cn/crtlprototypestudios/precisemanufacturing/foundation/ModContainerScreens.java new file mode 100644 index 0000000..66311a7 --- /dev/null +++ b/src/main/java/cn/crtlprototypestudios/precisemanufacturing/foundation/ModContainerScreens.java @@ -0,0 +1,16 @@ +package cn.crtlprototypestudios.precisemanufacturing.foundation; + +import cn.crtlprototypestudios.precisemanufacturing.foundation.client.gui.decomponentalizer.DecomponentalizerScreen; +import net.minecraft.client.gui.screens.MenuScreens; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; + +@Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) +public class ModContainerScreens { + @SubscribeEvent + public static void clientSetup(FMLClientSetupEvent evt) { + evt.enqueueWork(() -> MenuScreens.register(ModContainers.DECOMPONENTALIZER.get(), DecomponentalizerScreen::new)); + } +} \ No newline at end of file