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; } }
@Nullable public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { try { InputStream inputstream = new FileInputStream(this.resourceIndex.getPackMcmeta()); return AbstractResourcePack.readMetadata(metadataSerializer, inputstream, metadataSectionName); } catch (RuntimeException var4) { return (T)((IMetadataSection)null); } catch (FileNotFoundException var5) { return (T)((IMetadataSection)null); } }
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { try { InputStream inputstream = new FileInputStream(this.resourceIndex.getPackMcmeta()); return AbstractResourcePack.readMetadata(metadataSerializer, inputstream, metadataSectionName); } catch (RuntimeException var4) { return (T)null; } catch (FileNotFoundException var5) { return (T)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 <T extends IMetadataSection> T readMetadata(MetadataSerializer metadataSerializer, InputStream p_110596_1_, String sectionName) { JsonObject jsonobject = null; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(p_110596_1_, Charsets.UTF_8)); jsonobject = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); } catch (RuntimeException runtimeexception) { throw new JsonParseException(runtimeexception); } finally { IOUtils.closeQuietly((Reader)bufferedreader); } return metadataSerializer.parseMetadataSection(sectionName, jsonobject); }
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; } }
@Override public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { TypeUtils.cast(new ByteArrayInputStream(("{\n" + " \"pack\": {\n" + " \"description\": \"dummy FML pack for " + container.getName() + "\",\n" + " \"pack_format\": 1\n" + "}\n" + "}").getBytes(Charsets.UTF_8))); JsonObject jsonobject = null; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(("{\n" + " \"pack\": {\n" + " \"description\": \"dummy FML pack for " + container.getName() + "\",\n" + " \"pack_format\": 1\n" + "}\n" + "}").getBytes(Charsets.UTF_8)))); jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); } catch (RuntimeException runtimeexception) { throw new JsonParseException(runtimeexception); } finally { IOUtils.closeQuietly(bufferedreader); } return metadataSerializer.parseMetadataSection(metadataSectionName, jsonobject); }
public IMetadataSection getMetadata(String par1Str) { if (!this.hasMetadata()) { return null; } else { if (this.mcmetaJson == null && !this.mcmetaJsonChecked) { this.mcmetaJsonChecked = true; BufferedReader var2 = null; try { var2 = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); this.mcmetaJson = (new JsonParser()).parse(var2).getAsJsonObject(); } finally { IOUtils.closeQuietly(var2); } } IMetadataSection var6 = (IMetadataSection)this.mapMetadataSections.get(par1Str); if (var6 == null) { var6 = this.srMetadataSerializer.parseMetadataSection(par1Str, this.mcmetaJson); } return var6; } }
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); }
@Nullable public <T extends IMetadataSection> T getMetadata(String sectionName) { if (!this.hasMetadata()) { return (T)null; } else { if (this.mcmetaJson == null && !this.mcmetaJsonChecked) { this.mcmetaJsonChecked = true; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); this.mcmetaJson = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); } finally { IOUtils.closeQuietly((Reader)bufferedreader); } } T t = (T)this.mapMetadataSections.get(sectionName); if (t == null) { t = this.srMetadataSerializer.parseMetadataSection(sectionName, this.mcmetaJson); } return t; } }
public IMetadataSection getMetadata(String p_110526_1_) { if (!this.hasMetadata()) { return null; } else { if (this.mcmetaJson == null && !this.mcmetaJsonChecked) { this.mcmetaJsonChecked = true; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); this.mcmetaJson = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); } finally { IOUtils.closeQuietly(bufferedreader); } } IMetadataSection imetadatasection = (IMetadataSection)this.mapMetadataSections.get(p_110526_1_); if (imetadatasection == null) { imetadatasection = this.srMetadataSerializer.parseMetadataSection(p_110526_1_, this.mcmetaJson); } return imetadatasection; } }
@Override public IMetadataSection parseMetadataSection(String type, JsonObject json) { LiveryListMetadata result = new LiveryListMetadata(); if (json.has("cartlivery") && json.get("cartlivery").isJsonObject()) { JsonObject clMetaSection = json.getAsJsonObject("cartlivery"); if (clMetaSection.has("liverylist") && clMetaSection.get("liverylist").isJsonArray()) { for (JsonElement liveryElem : clMetaSection.getAsJsonArray("liverylist")) { if (liveryElem.isJsonPrimitive()) result.definedLiveries.add(liveryElem.getAsString()); } } } return result; }
@Nullable @Override public <T extends IMetadataSection> T getMetadata(String sectionName) { return null; }
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 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 <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return readMetadata(metadataSerializer, this.getInputStreamByName("pack.mcmeta"), metadataSectionName); }
@Nullable <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException;
@Nullable public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return this.field_191383_a.getPackMetadata(metadataSerializer, metadataSectionName); }
@Nullable <T extends IMetadataSection> T getMetadata(String sectionName);
public IMetadataSection getPackMetadata(final IMetadataSerializer p_135058_1_, final String p_135058_2_) throws IOException { return null; }
@Override public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return null; }
@Override @Nullable public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return null; }
@Nullable @Override public <T extends IMetadataSection> T getMetadata(String sectionName) { return wrapped.getMetadata(sectionName); }
@Override public IMetadataSection getMetadata(String p_110526_1_) { return null; }
@Override public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return null; }