diff --git a/build.gradle b/build.gradle index 20fc6203e..ad91f56cb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.6.396" apply false id "maven-publish" id 'com.matthewprenger.cursegradle' version '1.4.0' apply false id 'com.palantir.git-version' version '1.0.0' diff --git a/gradle.properties b/gradle.properties index 62548933a..896f56399 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ mixinextras_version=0.3.2 mod_id=modernfix minecraft_version=1.20.6 enabled_platforms=fabric,neoforge -forge_version=20.6.1-beta +forge_version=20.6.42-beta # parchment_version=2023.07.09 refined_storage_version=4392788 jei_version=16.0.0.28 diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixClientForge.java b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixClientForge.java index 5113967eb..c39dbbe48 100644 --- a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixClientForge.java +++ b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixClientForge.java @@ -11,8 +11,7 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModLoader; -import net.neoforged.fml.ModLoadingContext; -import net.neoforged.fml.ModLoadingWarning; +import net.neoforged.fml.ModLoadingIssue; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.ClientTickEvent; import net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent; @@ -52,7 +51,7 @@ private void keyBindRegister(RegisterKeyMappingsEvent event) { private void onClientSetup(FMLClientSetupEvent event) { if(false) { event.enqueueWork(() -> { - ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), "modernfix.connectedness_dynresoruces")); + ModLoader.addLoadingIssue(ModLoadingIssue.warning("modernfix.connectedness_dynresoruces")); }); } } diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixForge.java b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixForge.java index 52e208f68..f33a8158b 100644 --- a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixForge.java +++ b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixForge.java @@ -83,11 +83,11 @@ public void commonSetup(FMLCommonSetupEvent event) { boolean isPresent = !FMLLoader.isProduction() || warning.getLeft().stream().anyMatch(name -> ModList.get().isLoaded(name)); if(!isPresent) { atLeastOneWarning = true; - ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), warning.getRight())); + ModLoader.addLoadingIssue(ModLoadingIssue.warning(warning.getRight())); } } if(atLeastOneWarning) - ModLoader.addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), "modernfix.perf_mod_warning")); + ModLoader.addLoadingIssue(ModLoadingIssue.warning("modernfix.perf_mod_warning")); }); } } diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ForgeHooksClientMixin.java b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ForgeHooksClientMixin.java index 64122aa77..d5c01d808 100644 --- a/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ForgeHooksClientMixin.java +++ b/neoforge/src/main/java/org/embeddedt/modernfix/neoforge/mixin/perf/dynamic_resources/ForgeHooksClientMixin.java @@ -27,7 +27,7 @@ public class ForgeHooksClientMixin { */ @Redirect(method = "onModifyBakingResult", at = @At(value = "INVOKE", target = "Lnet/neoforged/fml/ModLoader;postEvent(Lnet/neoforged/bus/api/Event;)V"), remap = false) private static void postNamespacedKeySetEvent(Event event) { - if(!ModLoader.isLoadingStateValid()) + if(ModLoader.hasErrors()) return; ModelEvent.ModifyBakingResult bakeEvent = ((ModelEvent.ModifyBakingResult)event); ModelBakeEventHelper helper = new ModelBakeEventHelper(bakeEvent.getModels()); diff --git a/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java b/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java index eb66f11a5..2f95a3f48 100644 --- a/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java +++ b/neoforge/src/main/java/org/embeddedt/modernfix/platform/neoforge/ModernFixPlatformHooksImpl.java @@ -71,11 +71,11 @@ public MinecraftServer getCurrentServer() { } public boolean isEarlyLoadingNormally() { - return LoadingModList.get().getErrors().isEmpty(); + return !LoadingModList.get().hasErrors(); } public boolean isLoadingNormally() { - return isEarlyLoadingNormally() && ModLoader.isLoadingStateValid(); + return isEarlyLoadingNormally() && !ModLoader.hasErrors(); } public Path getGameDirectory() { diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 84a21e33d..76eb4c41c 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -47,7 +47,7 @@ modId = "neoforge" #mandatory # Does this dependency have to exist - if not, ordering below must be specified type = "required" #mandatory # The version range of the dependency -versionRange = "[20.5.0-beta,)" #mandatory +versionRange = "[20.6.42-beta,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering = "NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER