public <T extends IMetadataSection> T getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { try { InputStream inputstream = new FileInputStream((File)this.mapAssets.get("pack.mcmeta")); return AbstractResourcePack.readMetadata(p_135058_1_, inputstream, p_135058_2_); } catch (RuntimeException var4) { return (T)null; } catch (FileNotFoundException var5) { return (T)null; } }
public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { try { FileInputStream fileinputstream = new FileInputStream((File)this.mapAssets.get("pack.mcmeta")); return AbstractResourcePack.readMetadata(p_135058_1_, fileinputstream, p_135058_2_); } catch (RuntimeException var4) { return null; } catch (FileNotFoundException var5) { return null; } }
static IMetadataSection readMetadata(IMetadataSerializer par0MetadataSerializer, InputStream par1InputStream, String par2Str) { JsonObject var3 = null; BufferedReader var4 = null; try { var4 = new BufferedReader(new InputStreamReader(par1InputStream, Charsets.UTF_8)); var3 = (new JsonParser()).parse(var4).getAsJsonObject(); } finally { IOUtils.closeQuietly(var4); } return par0MetadataSerializer.parseMetadataSection(par2Str, var3); }
static IMetadataSection readMetadata(IMetadataSerializer p_110596_0_, InputStream p_110596_1_, String p_110596_2_) { JsonObject jsonobject = null; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(p_110596_1_, Charsets.UTF_8)); jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); } catch (RuntimeException runtimeexception) { throw new JsonParseException(runtimeexception); } finally { IOUtils.closeQuietly(bufferedreader); } return p_110596_0_.parseMetadataSection(p_110596_2_, jsonobject); }
public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { try { FileInputStream fileinputstream = new FileInputStream((File)this.field_152781_b.get("pack.mcmeta")); return AbstractResourcePack.readMetadata(p_135058_1_, fileinputstream, p_135058_2_); } catch (RuntimeException runtimeexception) { return null; } catch (FileNotFoundException filenotfoundexception) { return null; } }
public SimpleResource(String resourcePackNameIn, ResourceLocation srResourceLocationIn, InputStream resourceInputStreamIn, InputStream mcmetaInputStreamIn, IMetadataSerializer srMetadataSerializerIn) { this.resourcePackName = resourcePackNameIn; this.srResourceLocation = srResourceLocationIn; this.resourceInputStream = resourceInputStreamIn; this.mcmetaInputStream = mcmetaInputStreamIn; this.srMetadataSerializer = srMetadataSerializerIn; }
public ResourcePackRepository(File dirResourcepacksIn, File dirServerResourcepacksIn, IResourcePack rprDefaultResourcePackIn, IMetadataSerializer rprMetadataSerializerIn, GameSettings settings) { this.dirResourcepacks = dirResourcepacksIn; this.dirServerResourcepacks = dirServerResourcepacksIn; this.rprDefaultResourcePack = rprDefaultResourcePackIn; this.rprMetadataSerializer = rprMetadataSerializerIn; this.fixDirResourcepacks(); this.updateRepositoryEntriesAll(); Iterator<String> iterator = settings.resourcePacks.iterator(); while (iterator.hasNext()) { String s = (String)iterator.next(); for (ResourcePackRepository.Entry resourcepackrepository$entry : this.repositoryEntriesAll) { if (resourcepackrepository$entry.getResourcePackName().equals(s)) { if (resourcepackrepository$entry.func_183027_f() == 1 || settings.field_183018_l.contains(resourcepackrepository$entry.getResourcePackName())) { this.repositoryEntries.add(resourcepackrepository$entry); break; } iterator.remove(); logger.warn("Removed selected resource pack {} because it\'s no longer compatible", new Object[] {resourcepackrepository$entry.getResourcePackName()}); } } } }
private IResource load(ResourceLocation var1) { for(VirtualResource virtual : virtuals) { if(virtual.getResourceLocation().getResourceDomain().equals(var1.getResourceDomain()) && virtual.getResourceLocation().getResourcePath().equals(var1.getResourcePath())) { System.out.println("fetched virtual " + var1.getResourceDomain() + ":" + var1.getResourcePath()); return virtual.copy(); } } for(String domain : domains) { InputStream in = getInputStream(domain, var1); if(in == null) { try { IResource res = parent.getResource(var1); if(res != null) return res; } catch(IOException e) { ; // File doesn't exist } continue; } return new SimpleResource(domain, var1, in, null, new IMetadataSerializer()); } return null; }
public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, IMetadataSerializer par4MetadataSerializer) { this.srResourceLocation = par1ResourceLocation; this.resourceInputStream = par2InputStream; this.mcmetaInputStream = par3InputStream; this.srMetadataSerializer = par4MetadataSerializer; }
public ResourcePackRepository(File p_i45101_1_, File p_i45101_2_, IResourcePack p_i45101_3_, IMetadataSerializer p_i45101_4_, GameSettings p_i45101_5_) { this.dirResourcepacks = p_i45101_1_; this.field_148534_e = p_i45101_2_; this.rprDefaultResourcePack = p_i45101_3_; this.rprMetadataSerializer = p_i45101_4_; this.fixDirResourcepacks(); this.updateRepositoryEntriesAll(); Iterator var6 = p_i45101_5_.resourcePacks.iterator(); while (var6.hasNext()) { String var7 = (String)var6.next(); Iterator var8 = this.repositoryEntriesAll.iterator(); while (var8.hasNext()) { ResourcePackRepository.Entry var9 = (ResourcePackRepository.Entry)var8.next(); if (var9.getResourcePackName().equals(var7)) { this.repositoryEntries.add(var9); break; } } } }
public IMetadataSection getPackMetadata(IMetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { try { return AbstractResourcePack.readMetadata(par1MetadataSerializer, new FileInputStream(new File(this.fileAssets, "pack.mcmeta")), par2Str); } catch (FileNotFoundException var4) { return null; } }
@Override public IMetadataSection getPackMetadata(IMetadataSerializer metadataSerializer, String p_135058_2_) throws IOException { String fakePackMeta = "" + "{\n" + " 'pack': { \n" + " 'description': 'Additional resource files',\n" + " 'pack_format': 1\n" + " }\n" + "}"; fakePackMeta = fakePackMeta.replaceAll("'", "\""); JsonObject fakePackMetaJson = new JsonParser().parse(fakePackMeta).getAsJsonObject(); return metadataSerializer.parseMetadataSection(p_135058_2_, fakePackMetaJson); }
public SimpleResource(ResourceLocation p_i1300_1_, InputStream p_i1300_2_, InputStream p_i1300_3_, IMetadataSerializer p_i1300_4_) { this.srResourceLocation = p_i1300_1_; this.resourceInputStream = p_i1300_2_; this.mcmetaInputStream = p_i1300_3_; this.srMetadataSerializer = p_i1300_4_; }
public ResourcePackRepository(File p_i45101_1_, File p_i45101_2_, IResourcePack p_i45101_3_, IMetadataSerializer p_i45101_4_, GameSettings p_i45101_5_) { this.dirResourcepacks = p_i45101_1_; this.field_148534_e = p_i45101_2_; this.rprDefaultResourcePack = p_i45101_3_; this.rprMetadataSerializer = p_i45101_4_; this.fixDirResourcepacks(); this.updateRepositoryEntriesAll(); Iterator iterator = p_i45101_5_.resourcePacks.iterator(); while (iterator.hasNext()) { String s = (String)iterator.next(); Iterator iterator1 = this.repositoryEntriesAll.iterator(); while (iterator1.hasNext()) { ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator1.next(); if (entry.getResourcePackName().equals(s)) { this.repositoryEntries.add(entry); break; } } } }
public <T extends IMetadataSection> T getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return readMetadata(p_135058_1_, this.getInputStreamByName("pack.mcmeta"), p_135058_2_); }
public FallbackResourceManager(IMetadataSerializer frmMetadataSerializerIn) { this.frmMetadataSerializer = frmMetadataSerializerIn; }
public LanguageManager(IMetadataSerializer theMetadataSerializerIn, String currentLanguageIn) { this.theMetadataSerializer = theMetadataSerializerIn; this.currentLanguage = currentLanguageIn; I18n.setLocale(currentLocale); }
public SimpleReloadableResourceManager(IMetadataSerializer rmMetadataSerializerIn) { this.rmMetadataSerializer = rmMetadataSerializerIn; }
public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return readMetadata(p_135058_1_, this.getInputStreamByName("pack.mcmeta"), p_135058_2_); }
public IMetadataSection getPackMetadata(final IMetadataSerializer p_135058_1_, final String p_135058_2_) throws IOException { return null; }
@Override public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return null; }