Initial commit from the source zip for version 2.3.18

This commit is contained in:
Raven Szewczyk committed 2022-08-22 16:27:02 +01:00
commit dccbbdd63d
62 files changed
+12694

No files matched your search

@@ -0,0 +1,65 @@
package shadersmodcore.client;
import java.io.File;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
public class ShaderPackZip implements IShaderPack {
protected File packFile;
protected ZipFile packZipFile;
public ShaderPackZip(String name, File file)
{
packFile = file;
packZipFile = null;
}
@Override
public void close()
{
if(packZipFile != null)
{
try
{
packZipFile.close();
}
catch (Exception excp)
{
}
packZipFile = null;
}
}
@Override
public InputStream getResourceAsStream(String resName)
{
if (packZipFile == null)
{
try
{
packZipFile = new ZipFile(packFile);
}
catch (Exception excp)
{
}
}
if (packZipFile != null)
{
try
{
ZipEntry entry = packZipFile.getEntry(resName.substring(1));
if (entry != null)
{
return packZipFile.getInputStream(entry);
}
}
catch (Exception excp)
{
}
}
return null;
}
}