From f24ad0dfefd85742eea8b79bb2e979a673494490 Mon Sep 17 00:00:00 2001 From: modmuss Date: Thu, 4 Jan 2024 14:09:25 +0000 Subject: [PATCH] Validate jar and fail if it was built with Loom 1.5 or later. (#988) --- .../fabricmc/loom/configuration/mods/ArtifactMetadata.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java index 024a35c88..15822aca3 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java @@ -64,6 +64,12 @@ public static ArtifactMetadata create(ArtifactRef artifact) throws IOException { // Support opting into and out of remapping with "Fabric-Loom-Remap" manifest entry remapRequirements = Boolean.parseBoolean(value) ? RemapRequirements.OPT_IN : RemapRequirements.OPT_OUT; } + + // Check to see if the jar was built with a newer version of loom. + // This version of loom does not support the remap type value so throw an exception. + if (mainAttributes.getValue("Fabric-Loom-Mixin-Remap-Type") != null) { + throw new IllegalStateException("This version of loom does not support the mixin remap type value. Please update to the latest version of loom."); + } } final Path installerPath = fs.getPath(INSTALLER_PATH);