mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-07-28 14:08:55 +00:00
Fix a couple of issues with FileSystemMounts
- Only generate resource pack mounts if the desired directory exists. - Allow mounting files, as well as directories (fixes #90). As always, also a wee bit of cleanup to some of the surrounding code.
This commit is contained in:
@@ -100,6 +100,7 @@ import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.zip.ZipEntry;
|
||||
@@ -955,7 +956,7 @@ public class ComputerCraft
|
||||
{
|
||||
// Mount a resource pack from a jar
|
||||
FileSystem fs = FileSystems.newFileSystem( resourcePack.toPath(), ComputerCraft.class.getClassLoader() );
|
||||
mounts.add( new FileSystemMount( fs, subPath ) );
|
||||
if( Files.exists( fs.getPath( subPath ) ) ) mounts.add( new FileSystemMount( fs, subPath ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user