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

Intermediary name collisions result in mapping issues with 1.15.2 MCP #151

Open
DJtheRedstoner opened this issue Jul 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@DJtheRedstoner
Copy link

On 1.15.2, some classes (for example, Widget (mcp name)) aren't obfuscated in the Minecraft jar: https://github.com/FabricMC/intermediary/blob/master/mappings/1.15.2.tiny#L29870-L29885. This means that their obfuscated, intermediary and srg mappings are all the same. However, some other unobfuscated members are given srg names (thanks forge): https://github.com/MinecraftForge/MCPConfig/blob/master/versions/release/1.15.1/joined.tsrg#L57225. This creates a situation where the Map<String, String> model for intermediary to SRG breaks down. This can be observed by importing the below project and breakpointing

map.put(methodIntermediary, officialToMCP.get(methodTokenObf));
with a condition of methodIntermediary.equals("y") then observing officialToMCP.get(methodTokenObf) each time the breakpoint is hit.

This results in an incorrect mappings file which in turn leads to a jar with incorrect member names, resulting in compilation and remapping problems.

A sample project using 1.15.2 and MCP:

// build.gradle.kts
plugins {
    id("java")
    id("dev.architectury.loom") version "1.3-SNAPSHOT"
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    // mcp 1.15.1 is missing a pom, need to do this to get it to resolve. is this also an arch-loom bug?
    maven(url = "https://maven.minecraftforge.net/") {
        content {
            includeGroup("de.oceanlabs.mcp")
        }
        metadataSources {
            artifact()
        }
    }
}

dependencies {
    minecraft("com.mojang:minecraft:1.15.2")
    mappings("de.oceanlabs.mcp:mcp_snapshot:20211108-1.15.1@zip")
    forge("net.minecraftforge:forge:1.15.2-31.1.18")
}
// settings.gradle.kts
rootProject.name = "architectury-loom-mcp-fail"

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
        maven("https://maven.fabricmc.net")
        maven("https://maven.architectury.dev/")
        maven("https://maven.minecraftforge.net")
    }
}
@Juuxel Juuxel added the bug Something isn't working label Jul 27, 2023
Johni0702 added a commit to EssentialGG/UniversalCraft that referenced this issue Sep 11, 2023
Also removes 1.15 because of a bug in archloom ([1]).
Diff between 1.16.2-forge before and after the removal shows no significant
changes.

[1]: architectury/architectury-loom#151
Johni0702 added a commit to EssentialGG/UniversalCraft that referenced this issue Sep 13, 2023
Also removes 1.15 because of a bug in archloom ([1]).
Diff between 1.16.2-forge before and after the removal shows no significant
changes.

[1]: architectury/architectury-loom#151

GitHub: #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants