001package net.minecraft.client.texturepacks; 002 003import cpw.mods.fml.relauncher.Side; 004import cpw.mods.fml.relauncher.SideOnly; 005import java.io.BufferedInputStream; 006import java.io.File; 007import java.io.FileInputStream; 008import java.io.FileNotFoundException; 009import java.io.IOException; 010import java.io.InputStream; 011 012@SideOnly(Side.CLIENT) 013public class TexturePackFolder extends TexturePackImplementation 014{ 015 public TexturePackFolder(String par1, File par2, ITexturePack par3ITexturePack) 016 { 017 super(par1, par2, par2.getName(), par3ITexturePack); 018 } 019 020 protected InputStream func_98139_b(String par1Str) throws IOException 021 { 022 File file1 = new File(this.texturePackFile, par1Str.substring(1)); 023 024 if (!file1.exists()) 025 { 026 throw new FileNotFoundException(par1Str); 027 } 028 else 029 { 030 return new BufferedInputStream(new FileInputStream(file1)); 031 } 032 } 033 034 public boolean func_98140_c(String par1Str) 035 { 036 File file1 = new File(this.texturePackFile, par1Str); 037 return file1.exists() && file1.isFile(); 038 } 039 040 public boolean isCompatible() 041 { 042 File file1 = new File(this.texturePackFile, "textures/"); 043 boolean flag = file1.exists() && file1.isDirectory(); 044 boolean flag1 = this.func_98140_c("terrain.png") || this.func_98140_c("gui/items.png"); 045 return flag || !flag1; 046 } 047}