From ce96824589b2af85b1d66c7ec798a471f55c9994 Mon Sep 17 00:00:00 2001 From: Jab125 <67534807+Jab125@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:43:09 +1000 Subject: [PATCH] Add config to fix Mojmap forge --- gradle.properties | 2 +- .../dev/architectury/plugin/ArchitecturyPluginExtension.kt | 7 ++++++- src/main/kotlin/dev/architectury/plugin/ModLoader.kt | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 148c213..c6a33e7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,5 +5,5 @@ loom_version_010Legacy=0.10.0.171 loom_version_010=0.10.0.188 loom_version_011=0.11.0.217 loom_version_11=1.1.313 -transformer_version=5.2.83 +transformer_version=5.2.86 base_version=3.4 \ No newline at end of file diff --git a/src/main/kotlin/dev/architectury/plugin/ArchitecturyPluginExtension.kt b/src/main/kotlin/dev/architectury/plugin/ArchitecturyPluginExtension.kt index 04f4a6a..083419d 100644 --- a/src/main/kotlin/dev/architectury/plugin/ArchitecturyPluginExtension.kt +++ b/src/main/kotlin/dev/architectury/plugin/ArchitecturyPluginExtension.kt @@ -31,9 +31,10 @@ import java.util.jar.JarOutputStream import java.util.jar.Manifest open class ArchitectPluginExtension(val project: Project) { - var transformerVersion = "5.2.83" + var transformerVersion = "5.2.86" var injectablesVersion = "1.0.10" var minecraft = "" + internal var forgeUsesMojangMappings = false private var compileOnly = false var injectInjectables = true var addCommonMarker = true @@ -116,6 +117,8 @@ open class ArchitectPluginExtension(val project: Project) { map[BuiltinProperties.MAPPINGS_WITH_SRG] = loom.tinyMappingsWithSrg.toString() } + map[BuiltinProperties.FORGE_FIX_MIXINS] = (!this.forgeUsesMojangMappings).toString() + return map } @@ -284,6 +287,7 @@ open class ArchitectPluginExtension(val project: Project) { val loaders: MutableSet = LinkedHashSet(), val platformPackages: MutableMap = mutableMapOf(), var isForgeLike: Boolean = false, + var forgeUsesMojangMappings : Boolean = false, val extraForgeLikeToNeoForgeRemaps: MutableMap = mutableMapOf(), ) { constructor(loaders: Array) : this() { @@ -383,6 +387,7 @@ open class ArchitectPluginExtension(val project: Project) { it.loaders += ModLoader.FORGE action.execute(it) } + this.forgeUsesMojangMappings = settings.forgeUsesMojangMappings if (injectInjectables && !compileOnly) { var plsAddInjectables = false diff --git a/src/main/kotlin/dev/architectury/plugin/ModLoader.kt b/src/main/kotlin/dev/architectury/plugin/ModLoader.kt index acab21b..282c298 100644 --- a/src/main/kotlin/dev/architectury/plugin/ModLoader.kt +++ b/src/main/kotlin/dev/architectury/plugin/ModLoader.kt @@ -88,12 +88,15 @@ open class ModLoader( add(RemapInjectables()) { file -> this[BuiltinProperties.UNIQUE_IDENTIFIER] = projectGeneratedPackage(project, file) } - this += AddRefmapName() this += TransformPlatformOnly() this += TransformForgeAnnotations() this += TransformForgeEnvironment() - this += FixForgeMixin() + + if (!(project.extensions.getByName("architectury") as ArchitectPluginExtension).forgeUsesMojangMappings) { + this += AddRefmapName() + this += FixForgeMixin() + } loom.generateSrgTiny = true }