From 85d0c98e6b3fcdda05fc7265f20e54b17db0d895 Mon Sep 17 00:00:00 2001 From: Jonathing Date: Sun, 10 Nov 2024 16:24:52 -0500 Subject: [PATCH] Bump CoreMods to 5.2 (#10132) 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 Related dependency bumps: - Updated ASM to 9.7.1 - Updated Nashorn to 15.4 - Updated Log4J to 2.19.0 (included with installer) --- build.gradle | 20 +++++++++++++++---- .../minecraftforge/fml/loading/FMLLoader.java | 9 +++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 4391b5348f..10439b4b2d 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,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 @@ -43,12 +44,12 @@ ext { MCP_VERSION = '20220805.130853' 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.4' 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' @@ -61,7 +62,7 @@ ext { // These versions should be kept in sync with the version manifest JSON // To use a version newer than the version manifest JSON, the dependency must be added to the installer configuration MOJANG_LOGGING_VERSION = '1.0.0' - LOG4J_VERSION = '2.17.0' + LOG4J_VERSION = '2.19.0' GUAVA_VERSION = '31.0.1-jre' GSON_VERSION = '2.8.9' APACHE_COMMONS_LANG3_VERSION = '3.12.0' @@ -286,9 +287,12 @@ 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}" + installer "org.apache.logging.log4j:log4j-slf4j-impl:${LOG4J_VERSION}" // Bumped for CoreMods + installer "org.apache.logging.log4j:log4j-api:${LOG4J_VERSION}" // Bumped for CoreMods + installer "org.apache.logging.log4j:log4j-core:${LOG4J_VERSION}" // Bumped for CoreMods /* installer 'org.lwjgl:lwjgl:3.2.2' @@ -1727,4 +1731,12 @@ if (System.env.TEAMCITY_VERSION) { println "##teamcity[setParameter name='env.PUBLISHED_JAVA_FML_ARTIFACT_VERSION' value='${project(':fmlonly').version}']" } } +} + +idea { + module { + // IntelliJ IDEA does not do this by itself anymore... + downloadJavadoc = true + downloadSources = true + } } \ No newline at end of file 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");