From 1e5ba066a4fa047e01e018fbf68210b064de3406 Mon Sep 17 00:00:00 2001 From: Mari023 <38946771+Mari023@users.noreply.github.com> Date: Thu, 9 Jan 2025 20:07:40 +0100 Subject: [PATCH] fix #323 --- CHANGELOG.md | 2 +- .../java/de/mari_023/ae2wtlib/AE2wtlibClient.java | 12 ++++++++++++ .../java/de/mari_023/ae2wtlib/AE2wtlibForge.java | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b137891..6e047f6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ - +- fix dedicated server crashing (#323) diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibClient.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibClient.java index 0097c21b..0d62cde7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibClient.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibClient.java @@ -1,10 +1,22 @@ package de.mari_023.ae2wtlib; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; import net.minecraft.client.Minecraft; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; +@Mod(value = AE2wtlibAPI.MOD_NAME, dist = Dist.CLIENT) public class AE2wtlibClient { + public AE2wtlibClient(IEventBus modEventBus, ModContainer modContainer) { + modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } + public static void clientTick() { if (Minecraft.getInstance().player == null) return; diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java index a238c590..794e84b4 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java @@ -43,7 +43,6 @@ public AE2wtlibForge(IEventBus modEventBus, ModContainer modContainer) { CommonHooks.markComponentClassAsValid(ItemStack.class);// TODO figure out if there is a better way modContainer.registerConfig(ModConfig.Type.COMMON, AE2wtlibConfig.SPEC, AE2wtlibAPI.MOD_NAME + ".toml"); - modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); modEventBus.addListener((RegisterEvent e) -> { if (e.getRegistryKey().equals(Registries.MENU)) { AE2wtlib.registerMenus();