1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-28 04:17:38 +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:
SquidDev
2018-12-24 15:22:19 +00:00
parent 2032e7a83a
commit 5b48a0fa5f
9 changed files with 165 additions and 57 deletions

View File

@@ -39,7 +39,10 @@ public interface IComputerAccess
* @see IMount
*/
@Nullable
String mount( @Nonnull String desiredLocation, @Nonnull IMount mount );
default String mount( @Nonnull String desiredLocation, @Nonnull IMount mount )
{
return mount( desiredLocation, mount, getAttachmentName() );
}
/**
* Mount a mount onto the computer's file system in a read only mode.
@@ -75,7 +78,10 @@ public interface IComputerAccess
* @see IMount
*/
@Nullable
String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount );
default String mountWritable( @Nonnull String desiredLocation, @Nonnull IWritableMount mount )
{
return mountWritable( desiredLocation, mount, getAttachmentName() );
}
/**
* Mount a mount onto the computer's file system in a writable mode.