From de3c2056dae18c1365d14c42294a03c1ff22ca5d Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 22 Nov 2023 15:08:03 +0800 Subject: [PATCH] Fix merge conflicts --- .../loom/configuration/mods/ArtifactMetadata.java | 4 ++-- .../java/net/fabricmc/loom/task/RemapJarTask.java | 14 +++++++------- .../loom/test/integration/FabricAPITest.groovy | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) 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 49bc2c83..a96b69af 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java @@ -52,10 +52,10 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi private static final String QUILT_INSTALLER_PATH = "quilt_installer.json"; public static ArtifactMetadata create(ArtifactRef artifact, String currentLoomVersion) throws IOException { - return create(artifact, ModPlatform.FABRIC); + return create(artifact, currentLoomVersion, ModPlatform.FABRIC); } - public static ArtifactMetadata create(ArtifactRef artifact, ModPlatform platform) throws IOException { + public static ArtifactMetadata create(ArtifactRef artifact, String currentLoomVersion, ModPlatform platform) throws IOException { boolean isFabricMod; RemapRequirements remapRequirements = RemapRequirements.DEFAULT; InstallerData installerData = null; diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java index f94366c6..26250cf1 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java @@ -220,6 +220,13 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { if (mixinAp) { setupLegacyMixinRefmapRemapping(params); + } + + // Add the mixin refmap remap type to the manifest + // This is used by the mod dependency remapper to determine if it should remap the refmap + // or if the refmap should be remapped by mixin at runtime. + final var refmapRemapType = mixinAp ? ArtifactMetadata.MixinRemapType.MIXIN : ArtifactMetadata.MixinRemapType.STATIC; + params.getManifestAttributes().put(Constants.Manifest.MIXIN_REMAP_TYPE, refmapRemapType.manifestValue()); } else if (extension.isForge()) { throw new RuntimeException("Forge must have useLegacyMixinAp enabled"); } @@ -235,13 +242,6 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { if (!getAtAccessWideners().get().isEmpty()) { params.getMappingBuildServiceUuid().set(UnsafeWorkQueueHelper.create(MappingsService.createDefault(getProject(), serviceManagerProvider.get().get(), getSourceNamespace().get(), getTargetNamespace().get()))); - } - - // Add the mixin refmap remap type to the manifest - // This is used by the mod dependency remapper to determine if it should remap the refmap - // or if the refmap should be remapped by mixin at runtime. - final var refmapRemapType = mixinAp ? ArtifactMetadata.MixinRemapType.MIXIN : ArtifactMetadata.MixinRemapType.STATIC; - params.getManifestAttributes().put(Constants.Manifest.MIXIN_REMAP_TYPE, refmapRemapType.manifestValue()); } }); } diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy index a1890a51..20529681 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy @@ -60,10 +60,10 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait { """.stripIndent() } - // Change the plugin used - gradle.buildGradle.text = gradle.buildGradle.text - .replace('id "fabric-loom" version "1.4.1"', 'id "dev.architectury.loom"') - .replace('"fabric-loom"', '"dev.architectury.loom"') + mixinApPatch + // Change the plugin used + gradle.buildGradle.text = gradle.buildGradle.text + .replace('id "fabric-loom" version "1.4.1"', 'id "dev.architectury.loom"') + .replace('"fabric-loom"', '"dev.architectury.loom"') + mixinApPatch def minecraftVersion = "23w45a" def server = ServerRunner.create(gradle.projectDir, minecraftVersion)