From e0f8795c1fa65d584ce8f0ed0a9e0627cc3c0f3c Mon Sep 17 00:00:00 2001 From: Jonathing Date: Sun, 10 Nov 2024 16:44:35 -0500 Subject: [PATCH] [1.18.2] Bump CoreMods to 5.2 (#10133) 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 --- build.gradle | 18 +++++++++++++++--- fmlloader/build.gradle | 6 +++--- .../minecraftforge/fml/loading/FMLLoader.java | 9 +++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index a8ca21e9f7..7aa9de0ad5 100644 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,7 @@ plugins { id 'com.github.ben-manes.versions' version '0.36.0' id 'net.minecraftforge.gradleutils' version '[2.2,2.3)' id 'eclipse' + id 'idea' id 'de.undercouch.download' version '5.1.3' } @@ -57,12 +58,12 @@ ext { MCP_VERSION = '20220404.173914' SPI_VERSION = '4.0.15-4.x' ACCESSTRANSFORMERS_VERSION = '8.0.4' - COREMODS_VERSION = '5.0.1' + COREMODS_VERSION = '5.2.1' EVENTBUS_VERSION = '5.0.3' MODLAUNCHER_VERSION = '9.1.3' SECUREJARHANDLER_VERSION = '1.0.8' BOOTSTRAPLAUNCHER_VERSION = '1.0.0' - ASM_VERSION = '9.7' + ASM_VERSION = '9.7.1' INSTALLER_VERSION = '2.2.+' MIXIN_VERSION = '0.8.5' JARJAR_VERSION = '0.3.19' @@ -281,9 +282,12 @@ def sharedDeps = { installer 'org.jline:jline-reader:3.12.+' //Dep of TerminaalConsoleeAppender installer 'org.jline:jline-terminal:3.12.+' //Dep of TerminaalConsoleeAppender 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:2.19.0" // Bumped for CoreMods + installer "org.apache.logging.log4j:log4j-api:2.19.0" // Bumped for CoreMods + installer "org.apache.logging.log4j:log4j-core:2.19.0" // Bumped for CoreMods /* installer 'org.lwjgl:lwjgl:3.2.2' @@ -1650,4 +1654,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/build.gradle b/fmlloader/build.gradle index f461c8f150..2f8e08cdf5 100644 --- a/fmlloader/build.gradle +++ b/fmlloader/build.gradle @@ -17,7 +17,7 @@ dependencies { api("org.ow2.asm:asm-tree:${ASM_VERSION}") api("org.ow2.asm:asm-commons:${ASM_VERSION}") api("net.minecraftforge:forgespi:${SPI_VERSION}") - api('org.apache.logging.log4j:log4j-api:2.17.0') + api('org.apache.logging.log4j:log4j-api:2.19.0') api('org.slf4j:slf4j-api:1.8.0-beta4') api('com.google.guava:guava:21.0') api('com.google.code.gson:gson:2.8.9') @@ -31,8 +31,8 @@ dependencies { api "net.minecraftforge:JarJarMetadata:${JARJAR_VERSION}" implementation("cpw.mods:securejarhandler:${SECUREJARHANDLER_VERSION}") - implementation('org.apache.logging.log4j:log4j-core:2.17.0') - annotationProcessor('org.apache.logging.log4j:log4j-core:2.17.0') + implementation('org.apache.logging.log4j:log4j-core:2.19.0') + annotationProcessor('org.apache.logging.log4j:log4j-core:2.19.0') implementation('net.minecraftforge:accesstransformers:8.0.4') implementation('net.minecrell:terminalconsoleappender:1.2.0') // implementation('org.jline:jline:3.12.+') 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 52939c4a3c..96e5b65fe6 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.fatal(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");