Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to specify that Forge is Mojang mapped #47

Open
wants to merge 1 commit into
base: 3.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -284,6 +287,7 @@ open class ArchitectPluginExtension(val project: Project) {
val loaders: MutableSet<ModLoader> = LinkedHashSet(),
val platformPackages: MutableMap<ModLoader, String> = mutableMapOf(),
var isForgeLike: Boolean = false,
var forgeUsesMojangMappings : Boolean = false,
val extraForgeLikeToNeoForgeRemaps: MutableMap<String, String> = mutableMapOf(),
) {
constructor(loaders: Array<String>) : this() {
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/dev/architectury/plugin/ModLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down