mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-03 05:57:42 -05:00
at go brrr
This commit is contained in:
@@ -42,6 +42,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import org.gradle.api.Project;
|
||||
|
||||
import net.fabricmc.loom.util.TinyRemapperMappingsHelper;
|
||||
import net.fabricmc.loom.util.srg.AtRemapper;
|
||||
import net.fabricmc.loom.util.srg.CoreModClassRemapper;
|
||||
import net.fabricmc.mapping.tree.TinyTree;
|
||||
import net.fabricmc.tinyremapper.NonClassCopyMode;
|
||||
@@ -158,6 +159,7 @@ public class MinecraftMappedProvider extends DependencyProvider {
|
||||
}
|
||||
|
||||
TinyTree yarnWithSrg = getExtension().getMappingsProvider().getMappingsWithSrg();
|
||||
AtRemapper.remap(output, yarnWithSrg);
|
||||
CoreModClassRemapper.remapJar(output, yarnWithSrg, getProject().getLogger());
|
||||
}
|
||||
}
|
||||
@@ -169,6 +171,10 @@ public class MinecraftMappedProvider extends DependencyProvider {
|
||||
.withMappings(out -> JSR_TO_JETBRAINS.forEach(out::acceptClass))
|
||||
.renameInvalidLocals(true)
|
||||
.rebuildSourceFilenames(true)
|
||||
/* FORGE: Required for classes like aej$OptionalNamedTag (1.16.4) which are added by Forge patches.
|
||||
* They won't get remapped to their proper packages, so IllegalAccessErrors will happen without ._.
|
||||
*/
|
||||
.fixPackageAccess(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.net.URI;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@@ -41,7 +42,9 @@ import com.google.common.collect.ImmutableMap;
|
||||
public final class JarUtil {
|
||||
public static void extractFile(File jar, String filePath, File target) throws IOException {
|
||||
try (FileSystem fs = FileSystems.newFileSystem(URI.create("jar:" + jar.toURI()), ImmutableMap.of("create", false))) {
|
||||
Files.copy(fs.getPath(filePath), target.toPath());
|
||||
Path targetPath = target.toPath();
|
||||
Files.deleteIfExists(targetPath);
|
||||
Files.copy(fs.getPath(filePath), targetPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user