From 65ad537beb7f5be057674f1ac022c19208d8fe38 Mon Sep 17 00:00:00 2001 From: "Josiah (Gaming32) Glosson" Date: Sun, 21 Jan 2024 07:34:44 -0600 Subject: [PATCH] Fix NeoForge run --- .../java/io/github/gaming32/worldhost/WorldHost.java | 4 +++- .../worldhost/gui/screen/OnlineFriendsScreen.java | 1 - src/main/resources/META-INF/mods.toml | 12 ++++++++++-- version.gradle.kts | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/gaming32/worldhost/WorldHost.java b/src/main/java/io/github/gaming32/worldhost/WorldHost.java index 38c24c8..22496b8 100644 --- a/src/main/java/io/github/gaming32/worldhost/WorldHost.java +++ b/src/main/java/io/github/gaming32/worldhost/WorldHost.java @@ -87,7 +87,6 @@ //#endif //#else //$$ import io.github.gaming32.worldhost.gui.screen.WorldHostConfigScreen; -//$$ import net.minecraft.client.gui.screens.Screen; //$$ import net.minecraft.server.packs.PackType; //$$ import net.minecraft.server.packs.PackResources; //#if FORGE @@ -240,6 +239,9 @@ private static void init() { //#else //$$ .getResourcePackFor(MOD_ID) //#endif + //#if MC >= 1.20.4 + //$$ .map(c -> c.openPrimary("worldhost")) + //#endif //$$ .map(c -> { //#if MC <= 1.19.2 //$$ try { diff --git a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java index 3d343a7..0fdfc6e 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java @@ -37,7 +37,6 @@ //#endif //#if MC >= 1.20.4 && FABRIC -import de.florianmichael.viafabricplus.screen.base.ProtocolSelectionScreen; import de.florianmichael.viafabricplus.settings.impl.GeneralSettings; import net.fabricmc.loader.api.FabricLoader; //#if MC >= 1.20.1 diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 0517f59..fc98706 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -29,13 +29,16 @@ description = "Host your singleplayer worlds without having to run a server or s modId = "neoforge" versionRange = "[20,)" ##endif -mandatory = true +##if MC < 1.20.4 +#?? mandatory = true +##else +type = "required" +##endif ordering = "NONE" side = "BOTH" [[dependencies.world_host]] modId = "minecraft" -mandatory = true ##if MC == 1.20.1 #?? versionRange = "[1.20,1.20.2)" ##elseif MC == 1.20.4 @@ -43,5 +46,10 @@ versionRange = "[1.20.3,1.20.5)" ##else #?? versionRange = "$mc_version" ##endif +##if MC < 1.20.4 +#?? mandatory = true +##else +type = "required" +##endif ordering = "NONE" side = "BOTH" diff --git a/version.gradle.kts b/version.gradle.kts index 02f17fd..2df6dc8 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -100,7 +100,7 @@ unimined.minecraft { isNeoForge -> neoForged { loader(when (mcVersion) { 1_20_02 -> "86" - 1_20_04 -> "2-beta" + 1_20_04 -> "69-beta" else -> throw IllegalStateException("Unknown NeoForge version for $mcVersionString") }) minecraftRemapper.config {