From 2c5baf95cb8faa2278328daf4d8192de0a36b326 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 19 Jan 2022 22:41:12 +0000 Subject: [PATCH] Cleanup runtime only log4j, allow it on any version. --- .../providers/minecraft/MinecraftLibraryProvider.java | 4 ++-- src/main/java/net/fabricmc/loom/util/Constants.java | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftLibraryProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftLibraryProvider.java index 13cdb05..9782310 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftLibraryProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftLibraryProvider.java @@ -42,7 +42,7 @@ public class MinecraftLibraryProvider { final MinecraftJarConfiguration jarConfiguration = extension.getMinecraftJarConfiguration().get(); final MinecraftVersionMeta versionInfo = minecraftProvider.getVersionInfo(); final BundleMetadata serverBundleMetadata = minecraftProvider.getServerBundleMetadata(); - final boolean runtimeOnlyLog4j = versionInfo.isVersionOrNewer(Constants.MinecraftReleaseTimes.MC_22W03A) && extension.getRuntimeOnlyLog4j().get(); + final boolean runtimeOnlyLog4j = extension.getRuntimeOnlyLog4j().get(); final boolean overrideLWJGL = LWJGLVersionOverride.overrideByDefault() || LWJGLVersionOverride.forceOverride(project) || Boolean.getBoolean("loom.test.lwjgloverride"); @@ -57,7 +57,7 @@ public class MinecraftLibraryProvider { if (library.isValidForOS() && !library.hasNatives() && library.artifact() != null) { if (runtimeOnlyLog4j && library.name().startsWith("org.apache.logging.log4j")) { - // Make log4j a runtime only dep in 20w03a or later. Modders should use SLF4J. + // Make log4j a runtime only dep to force slf4j. project.getDependencies().add(Constants.Configurations.MINECRAFT_RUNTIME_DEPENDENCIES, library.name()); } else if (serverBundleMetadata != null && isLibraryInBundle(serverBundleMetadata, library)) { project.getDependencies().add(Constants.Configurations.MINECRAFT_SERVER_DEPENDENCIES, library.name()); diff --git a/src/main/java/net/fabricmc/loom/util/Constants.java b/src/main/java/net/fabricmc/loom/util/Constants.java index ae70d3f..a23105d 100644 --- a/src/main/java/net/fabricmc/loom/util/Constants.java +++ b/src/main/java/net/fabricmc/loom/util/Constants.java @@ -142,8 +142,4 @@ public class Constants { private TaskGroup() { } } - - public static final class MinecraftReleaseTimes { - public static final String MC_22W03A = "2022-01-19T16:04:59+00:00"; - } }