From 621d3f8494d619ef61fb9c5affca7af277963811 Mon Sep 17 00:00:00 2001 From: Jonathing Date: Fri, 8 Nov 2024 21:19:04 -0500 Subject: [PATCH] [1.19.4] Bump CoreMods to 5.2 (#10131) Full Changelog: https://gist.github.com/Jonathing/c3ad28b2a048ac839a7baba5417ee870 The key features are: - ES6 language support - Thoroughly updated ASMAPI, with full documentation - Bug fixes (some optional for backwards-compatibility) - Partial internal code cleanup - Request CoreMods to not apply fix for ASMAPI.findFirstInstructionBefore by default - Updated ASM to 9.7.1 - Updated Nashorn to 15.4 --- build.gradle | 15 ++++++++++++--- .../net/minecraftforge/fml/loading/FMLLoader.java | 9 +++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index cd26cc5de8..420c8c0a3d 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,7 @@ plugins { id 'com.github.ben-manes.versions' version '0.46.0' id 'net.minecraftforge.gradleutils' version '[2.2,2.3)' id 'eclipse' + id 'idea' id 'de.undercouch.download' version '5.4.0' id 'net.minecraftforge.gradle.patcher' version '[6.0,6.2)' apply false id 'net.minecraftforge.gradle.mcp' version '[6.0,6.2)' apply false @@ -50,12 +51,12 @@ ext { MCP_VERSION = '20230314.122934' SPI_VERSION = '6.0.0' ACCESSTRANSFORMERS_VERSION = '8.0.4' - COREMODS_VERSION = '5.0.1' + COREMODS_VERSION = '5.2.1' EVENTBUS_VERSION = '6.0.3' MODLAUNCHER_VERSION = '10.0.8' SECUREJARHANDLER_VERSION = '2.1.6' BOOTSTRAPLAUNCHER_VERSION = '1.1.2' - ASM_VERSION = '9.7' + ASM_VERSION = '9.7.1' INSTALLER_VERSION = '2.2.+' MIXIN_VERSION = '0.8.5' TERMINALCONSOLEAPPENDER_VERSION = '1.2.0' @@ -293,7 +294,7 @@ def sharedDeps = { installer "org.jline:jline-reader:${JLINE_VERSION}" // Dep of TerminalConsoleAppender installer "org.jline:jline-terminal:${JLINE_VERSION}" // Dep of TerminalConsoleAppender installer "org.spongepowered:mixin:${MIXIN_VERSION}" - installer 'org.openjdk.nashorn:nashorn-core:15.3' + installer 'org.openjdk.nashorn:nashorn-core:15.4' installer "net.minecraftforge:JarJarSelector:${JARJAR_VERSION}" installer "net.minecraftforge:JarJarMetadata:${JARJAR_VERSION}" @@ -1798,3 +1799,11 @@ if (System.env.TEAMCITY_VERSION) { } } } + +idea { + module { + // IntelliJ IDEA does not do this by itself anymore... + downloadJavadoc = true + downloadSources = true + } +} diff --git a/fmlloader/src/main/java/net/minecraftforge/fml/loading/FMLLoader.java b/fmlloader/src/main/java/net/minecraftforge/fml/loading/FMLLoader.java index 7cf191366f..7b7b885632 100644 --- a/fmlloader/src/main/java/net/minecraftforge/fml/loading/FMLLoader.java +++ b/fmlloader/src/main/java/net/minecraftforge/fml/loading/FMLLoader.java @@ -66,6 +66,9 @@ public class FMLLoader throw new IncompatibleEnvironmentException("Incompatible modlauncher found "+modLauncherPackage.getSpecificationVersion()); } + // Allows us to communicate properties with other services through ModLauncher + setupBlackboardKeys(); + accessTransformer = (AccessTransformerService) environment.findLaunchPlugin("accesstransformer").orElseThrow(()-> { LOGGER.error(CORE, "Access Transformer library is missing, we need this to run"); return new IncompatibleEnvironmentException("Missing AccessTransformer, cannot run"); @@ -127,6 +130,12 @@ public class FMLLoader } } + private static void setupBlackboardKeys() { + LOGGER.debug(CORE, "Requesting CoreMods to not apply the fix for ASMAPI.findFirstInstructionBefore by default"); + var blackboardKey = TypesafeMap.Key.getOrCreate(Launcher.INSTANCE.blackboard(), "coremods.use_old_findFirstInstructionBefore", Boolean.class); + Launcher.INSTANCE.blackboard().computeIfAbsent(blackboardKey, k -> true); + } + static void setupLaunchHandler(final IEnvironment environment, final Map arguments) { final String launchTarget = environment.getProperty(IEnvironment.Keys.LAUNCHTARGET.get()).orElse("MISSING");