Skip to content

Commit

Permalink
Add reflection redirector
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Nov 15, 2023
1 parent d43b9c2 commit 5687252
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gradle/runtime.libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ native-support = "1.0.1"

# Forge Runtime depedencies
javax-annotations = "3.0.2"
forge-runtime = "2.0.9"
forge-runtime = "2.0.9999"
access-transformers = "3.0.1"
access-transformers-new = "8.0.5"
unprotect = "1.2.0"
Expand All @@ -37,6 +37,7 @@ javax-annotations = { module = "com.google.code.findbugs:jsr305", version.ref =
mixin-remapper-service = { module = "dev.architectury:architectury-mixin-remapper-service", version.ref = "forge-runtime" }
naming-service = { module = "dev.architectury:architectury-naming-service", version.ref = "forge-runtime" }
mcp-annotations = { module = "dev.architectury:mcp-annotations", version.ref = "forge-runtime" }
reflection-redirector = { module = "dev.architectury:architectury-reflection-redirector", version.ref = "forge-runtime" }
access-transformers = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers" }
access-transformers-new = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers-new" }
unprotect = { module = "io.github.juuxel:unprotect", version.ref = "unprotect" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ public void run() {
getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.MIXIN_REMAPPER_SERVICE.mavenNotation());
getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.MCP_ANNOTATIONS.mavenNotation());
}

// Add NeoForge-only dev-time dependencies
if (extension.isNeoForge()) {
getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.REFLECTION_REDIRECTOR.mavenNotation());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ public void run() throws IOException {
}
}

if (getExtension().isNeoForge()) {
launchConfig
// See ArchitecturyReflectionRedirectorPlugin in forge-runtime
.property("architectury.reflectionredirector.sourceNamespace", intermediateNs)
.property("architectury.reflectionredirector.mappingsPath", mappingsPath);
}

ForgeRunsProvider forgeRunsProvider = getExtension().getForgeRunsProvider();
ConfigValue.Resolver configResolver = forgeRunsProvider.getResolver(null);

Expand Down

0 comments on commit 5687252

Please sign in to comment.