Fix building on newer java versions

dev/0.11
modmuss50 2020-05-27 14:38:45 +01:00
parent 016645d315
commit 2645fef789
2 changed files with 5 additions and 5 deletions

View File

@ -153,7 +153,7 @@ public class MappingsProvider extends DependencyProvider {
private void storeMappings(Project project, MinecraftProvider minecraftProvider, Path yarnJar) throws IOException {
project.getLogger().lifecycle(":extracting " + yarnJar.getFileName());
try (FileSystem fileSystem = FileSystems.newFileSystem(yarnJar, null)) {
try (FileSystem fileSystem = FileSystems.newFileSystem(yarnJar, (ClassLoader) null)) {
extractMappings(fileSystem, baseTinyMappings);
}
@ -189,7 +189,7 @@ public class MappingsProvider extends DependencyProvider {
}
private boolean doesJarContainV2Mappings(Path path) throws IOException {
try (FileSystem fs = FileSystems.newFileSystem(path, null)) {
try (FileSystem fs = FileSystems.newFileSystem(path, (ClassLoader) null)) {
try (BufferedReader reader = Files.newBufferedReader(fs.getPath("mappings", "mappings.tiny"))) {
TinyV2Factory.readMetadata(reader);
return true;
@ -207,14 +207,14 @@ public class MappingsProvider extends DependencyProvider {
Path unmergedIntermediary = Paths.get(mappingsStepsDir.toString(), "unmerged-intermediary.tiny");
project.getLogger().info(":extracting " + unmergedIntermediaryJar.getFileName());
try (FileSystem unmergedIntermediaryFs = FileSystems.newFileSystem(unmergedIntermediaryJar, null)) {
try (FileSystem unmergedIntermediaryFs = FileSystems.newFileSystem(unmergedIntermediaryJar, (ClassLoader) null)) {
extractMappings(unmergedIntermediaryFs, unmergedIntermediary);
}
Path unmergedYarn = Paths.get(mappingsStepsDir.toString(), "unmerged-yarn.tiny");
project.getLogger().info(":extracting " + unmergedYarnJar.getFileName());
try (FileSystem unmergedYarnJarFs = FileSystems.newFileSystem(unmergedYarnJar, null)) {
try (FileSystem unmergedYarnJarFs = FileSystems.newFileSystem(unmergedYarnJar, (ClassLoader) null)) {
extractMappings(unmergedYarnJarFs, unmergedYarn);
}

View File

@ -136,7 +136,7 @@ public class MigrateMappingsTask extends AbstractLoomTask {
private static TinyTree getMappings(File mappings) throws IOException {
Path temp = Files.createTempFile("mappings", ".tiny");
try (FileSystem fileSystem = FileSystems.newFileSystem(mappings.toPath(), null)) {
try (FileSystem fileSystem = FileSystems.newFileSystem(mappings.toPath(), (ClassLoader) null)) {
Files.copy(fileSystem.getPath("mappings/mappings.tiny"), temp, StandardCopyOption.REPLACE_EXISTING);
}