mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 21:47:42 -05:00
Try using SpecialSource directly instead of going through ForgeGradle
This commit is contained in:
@@ -74,7 +74,7 @@ dependencies {
|
|||||||
implementation ('org.cadixdev:lorenz:0.5.3')
|
implementation ('org.cadixdev:lorenz:0.5.3')
|
||||||
implementation ('org.cadixdev:lorenz-asm:0.5.3')
|
implementation ('org.cadixdev:lorenz-asm:0.5.3')
|
||||||
implementation ('org.cadixdev:atlas:0.2.0')
|
implementation ('org.cadixdev:atlas:0.2.0')
|
||||||
implementation ('net.minecraftforge.gradle:ForgeGradle:3.0.179')
|
implementation ('net.md-5:SpecialSource:1.8.6')
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
testImplementation(gradleTestKit())
|
testImplementation(gradleTestKit())
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import net.md_5.specialsource.SpecialSource;
|
||||||
import net.minecraftforge.binarypatcher.ConsoleTool;
|
import net.minecraftforge.binarypatcher.ConsoleTool;
|
||||||
import net.minecraftforge.gradle.mcp.util.MCPRuntime;
|
|
||||||
import net.minecraftforge.gradle.mcp.util.MCPWrapper;
|
|
||||||
import org.cadixdev.atlas.Atlas;
|
import org.cadixdev.atlas.Atlas;
|
||||||
import org.cadixdev.bombe.asm.jar.JarEntryRemappingTransformer;
|
import org.cadixdev.bombe.asm.jar.JarEntryRemappingTransformer;
|
||||||
import org.cadixdev.lorenz.MappingSet;
|
import org.cadixdev.lorenz.MappingSet;
|
||||||
@@ -237,26 +236,10 @@ public class MinecraftProvider extends DependencyProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createSrgJars(Logger logger) throws Exception {
|
private void createSrgJars(Logger logger) throws Exception {
|
||||||
logger.lifecycle(":remapping minecraft (MCP, official -> srg)");
|
logger.lifecycle(":remapping minecraft (SpecialSource, official -> srg)");
|
||||||
|
String mappings = getExtension().getMcpConfigProvider().getSrg().getAbsolutePath();
|
||||||
McpConfigProvider volde = getExtension().getMcpConfigProvider();
|
SpecialSource.main(new String[] { "--in-jar", minecraftClientJar.getAbsolutePath(), "--out-jar", minecraftClientSrgJar.getAbsolutePath(), "--srg-in", mappings });
|
||||||
File root = new File(getExtension().getUserCache(), "mcp_root");
|
SpecialSource.main(new String[] { "--in-jar", minecraftServerJar.getAbsolutePath(), "--out-jar", minecraftServerSrgJar.getAbsolutePath(), "--srg-in", mappings });
|
||||||
root.mkdirs();
|
|
||||||
MCPWrapper wrapper = new MCPWrapper(volde.getMcp(), root);
|
|
||||||
|
|
||||||
// Client
|
|
||||||
{
|
|
||||||
MCPRuntime runtime = wrapper.getRuntime(getProject(), "client");
|
|
||||||
File output = runtime.execute(logger, "rename");
|
|
||||||
Files.copy(output, minecraftClientSrgJar);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Server
|
|
||||||
{
|
|
||||||
MCPRuntime runtime = wrapper.getRuntime(getProject(), "server");
|
|
||||||
File output = runtime.execute(logger, "rename");
|
|
||||||
Files.copy(output, minecraftServerSrgJar);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void injectForgeClasses(Logger logger) throws IOException {
|
private void injectForgeClasses(Logger logger) throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user