1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-14 12:07:10 +00:00

Fix resource handle loading

See #70
This commit is contained in:
SquidDev
2018-10-29 15:59:43 +00:00
parent 7e334bd4a5
commit d53a73e7e7
4 changed files with 28 additions and 11 deletions

View File

@@ -928,7 +928,7 @@ public class ComputerCraft
FileSystem fs = FileSystems.newFileSystem( modJar.toPath(), ComputerCraft.class.getClassLoader() );
mounts.add( new FileSystemMount( fs, subPath ) );
}
catch( IOException | ProviderNotFoundException | ServiceConfigurationError e )
catch( IOException | RuntimeException | ServiceConfigurationError e )
{
ComputerCraft.log.error( "Could not load mount from mod jar", e );
// Ignore
@@ -940,16 +940,16 @@ public class ComputerCraft
if( resourcePackDir.exists() && resourcePackDir.isDirectory() )
{
String[] resourcePacks = resourcePackDir.list();
for( String resourcePack1 : resourcePacks )
for( String resourcePackName : resourcePacks )
{
try
{
File resourcePack = new File( resourcePackDir, resourcePack1 );
File resourcePack = new File( resourcePackDir, resourcePackName );
if( !resourcePack.isDirectory() )
{
// Mount a resource pack from a jar
IMount resourcePackMount = new FileSystemMount( FileSystems.getFileSystem( resourcePack.toURI() ), subPath );
mounts.add( resourcePackMount );
FileSystem fs = FileSystems.newFileSystem( resourcePack.toPath(), ComputerCraft.class.getClassLoader() );
mounts.add( new FileSystemMount( fs, subPath ) );
}
else
{
@@ -962,9 +962,9 @@ public class ComputerCraft
}
}
}
catch( IOException e )
catch( IOException | RuntimeException | ServiceConfigurationError e )
{
ComputerCraft.log.error( "Could not load resource pack '" + resourcePack1 + "'", e );
ComputerCraft.log.error( "Could not load resource pack '" + resourcePackName + "'", e );
}
}
}