Fixed several resource filesystem bugs
This commit is contained in:
parent
8313c08034
commit
c675729996
|
@ -1,3 +1,6 @@
|
|||
## 22.0.0.0-alpha.7
|
||||
* `[PlutoRuntime]` Fixed several resource filesystem bugs
|
||||
|
||||
## 22.0.0.0-alpha.6
|
||||
* `[PlutoSpritesheet]` Added a constructor to `PartialTextureSprite` that initializes the spritesheet to `null`
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ object Versions {
|
|||
|
||||
const val isPrerelease = true
|
||||
const val prereleaseName = "alpha"
|
||||
const val prerealeaseUpdate = 6
|
||||
const val prerealeaseUpdate = 7
|
||||
|
||||
val versionFull =
|
||||
if (isPrerelease)
|
||||
|
|
|
@ -156,7 +156,14 @@ public class ResourceFileSystemProvider extends FileSystemProvider
|
|||
@Override
|
||||
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) throws IOException
|
||||
{
|
||||
return super.newAsynchronousFileChannel(path, options, executor, attrs);
|
||||
if (!(path instanceof ResourcePath rp))
|
||||
throw new IllegalArgumentException("Expected a path of type %s!".formatted(ResourcePath.class));
|
||||
|
||||
var backingPath = rp.getBackingPath();
|
||||
var backingFileSystem = backingPath.getFileSystem();
|
||||
var backingProvider = backingFileSystem.provider();
|
||||
|
||||
return backingProvider.newAsynchronousFileChannel(backingPath, options, executor, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.plutoengine.mod.Mod;
|
|||
import javax.annotation.concurrent.ThreadSafe;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.ProviderNotFoundException;
|
||||
import java.nio.file.spi.FileSystemProvider;
|
||||
|
@ -30,9 +31,7 @@ public class ResourceManager implements Closeable
|
|||
{
|
||||
try
|
||||
{
|
||||
var loader = ServiceLoader.load(FileSystemProvider.class, ResourceFileSystemProvider.class.getClassLoader());
|
||||
|
||||
for (FileSystemProvider provider : loader)
|
||||
for (FileSystemProvider provider : FileSystemProvider.installedProviders())
|
||||
{
|
||||
if (provider.getScheme().equals(URI_SCHEME))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue