From da7c0eea1ad597afa6a241940e05b77d7d53f2c3 Mon Sep 17 00:00:00 2001 From: Allink Date: Mon, 24 Apr 2023 16:28:17 +0100 Subject: [PATCH] Load ClassicItemSelectionScreen after Minecraft has initialized Fixes #68 --- .../de/florianmichael/viafabricplus/ViaFabricPlus.java | 10 ++++++++-- src/main/resources/fabric.mod.json | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index 5797339f..d37ca55e 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -34,12 +34,13 @@ import de.florianmichael.viafabricplus.event.PreLoadCallback; import de.florianmichael.viafabricplus.information.InformationSystem; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.settings.SettingsSystem; +import net.fabricmc.api.ModInitializer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.File; -public class ViaFabricPlus { +public class ViaFabricPlus implements ModInitializer { public final static Gson GSON = new GsonBuilder().setPrettyPrinting().create(); public final static Logger LOGGER = LogManager.getLogger("ViaFabricPlus"); public final static File RUN_DIRECTORY = new File("ViaFabricPlus"); @@ -55,7 +56,6 @@ public class ViaFabricPlus { // Classic Stuff CustomClassicProtocolExtensions.create(); ClassicProtocolCommands.create(); - ClassicItemSelectionScreen.create(); // Account Handler ClassiCubeAccountHandler.create(); @@ -87,4 +87,10 @@ public class ViaFabricPlus { public InformationSystem getInformationSystem() { return informationSystem; } + + // #68 - ViaFabricPlus make minecraft crash when run with Iceberg + @Override + public void onInitialize() { + ClassicItemSelectionScreen.create(); + } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index a0adfab1..a8028a5c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -20,6 +20,9 @@ "entrypoints": { "modmenu": [ "de.florianmichael.viafabricplus.integration.ModMenuImpl" + ], + "main": [ + "de.florianmichael.viafabricplus.ViaFabricPlus" ] }, "mixins": [