@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; } }
void init() { LiteLoader.getInput().registerKeyBinding(SETTINGS_GUI); this.config = new PonyConfig(); this.ponyManager = new PonyManager(config); LiteLoader.getInstance().registerExposable(config, null); IReloadableResourceManager irrm = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); irrm.registerReloadListener(this.ponyManager); MetadataSerializer ms = Minecraft.getMinecraft().getResourcePackRepository().rprMetadataSerializer; ms.registerMetadataSectionType(new PonyDataSerialzier(), IPonyData.class); // This also makes it the default gateway server. SkinServer.defaultServers.add("legacy:http://minelpskins.voxelmodpack.com;http://minelpskinmanager.voxelmodpack.com"); }
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); }
public ResourcePackRepository(File p_i1297_1_, ResourcePack p_i1297_2_, MetadataSerializer p_i1297_3_, GameSettings p_i1297_4_) { this.field_110618_d = p_i1297_1_; this.field_110620_b = p_i1297_2_; this.field_110621_c = p_i1297_3_; this.func_110616_f(); this.func_110611_a(); Iterator var5 = this.field_110619_e.iterator(); while(var5.hasNext()) { ResourcePackRepositoryEntry var6 = (ResourcePackRepositoryEntry)var5.next(); if(var6.func_110515_d().equals(p_i1297_4_.field_74346_m)) { this.field_110617_f.add(var6); } } }
static MetadataSection readMetadata(MetadataSerializer par0MetadataSerializer, InputStream par1InputStream, String par2Str) { JsonObject jsonobject = null; BufferedReader bufferedreader = null; try { bufferedreader = new BufferedReader(new InputStreamReader(par1InputStream)); jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); } finally { IOUtils.closeQuietly(bufferedreader); } return par0MetadataSerializer.parseMetadataSection(par2Str, jsonobject); }
public ResourcePackRepository(File par1File, ResourcePack par2ResourcePack, MetadataSerializer par3MetadataSerializer, GameSettings par4GameSettings) { this.dirResourcepacks = par1File; this.rprDefaultResourcePack = par2ResourcePack; this.rprMetadataSerializer = par3MetadataSerializer; this.fixDirResourcepacks(); this.updateRepositoryEntriesAll(); Iterator iterator = this.repositoryEntriesAll.iterator(); while (iterator.hasNext()) { ResourcePackRepositoryEntry resourcepackrepositoryentry = (ResourcePackRepositoryEntry)iterator.next(); if (resourcepackrepositoryentry.getResourcePackName().equals(par4GameSettings.skin)) { this.repositoryEntries.add(resourcepackrepositoryentry); } } }
private static MetadataSerializer makeMetadataSerializer() { MetadataSerializer metadataserializer = new MetadataSerializer(); metadataserializer.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); metadataserializer.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); metadataserializer.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); metadataserializer.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); metadataserializer.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); return metadataserializer; }
public SimpleResource(String resourcePackNameIn, ResourceLocation srResourceLocationIn, InputStream resourceInputStreamIn, InputStream mcmetaInputStreamIn, MetadataSerializer srMetadataSerializerIn) { this.resourcePackName = resourcePackNameIn; this.srResourceLocation = srResourceLocationIn; this.resourceInputStream = resourceInputStreamIn; this.mcmetaInputStream = mcmetaInputStreamIn; this.srMetadataSerializer = srMetadataSerializerIn; }
public ResourcePackRepository(File dirResourcepacksIn, File dirServerResourcepacksIn, IResourcePack rprDefaultResourcePackIn, MetadataSerializer 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.getPackFormat() == 3 || settings.incompatibleResourcePacks.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()}); } } } }
public ResourcePackRepository(File dirResourcepacksIn, File dirServerResourcepacksIn, IResourcePack rprDefaultResourcePackIn, MetadataSerializer 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.getPackFormat() == 2 || settings.incompatibleResourcePacks.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()}); } } } }
@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); }
static MetadataSection func_110596_a(MetadataSerializer p_110596_0_, InputStream p_110596_1_, String p_110596_2_) { JsonObject var3 = null; BufferedReader var4 = null; try { var4 = new BufferedReader(new InputStreamReader(p_110596_1_)); var3 = (new JsonParser()).parse(var4).getAsJsonObject(); } finally { IOUtils.closeQuietly(var4); } return p_110596_0_.func_110503_a(p_110596_2_, var3); }
public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, MetadataSerializer par4MetadataSerializer) { this.srResourceLocation = par1ResourceLocation; this.resourceInputStream = par2InputStream; this.mcmetaInputStream = par3InputStream; this.srMetadataSerializer = par4MetadataSerializer; }
private TextureMetadataSection loadTextureMetadataSection() { String s = this.texturePath + ".mcmeta"; String s1 = "texture"; InputStream inputstream = Shaders.getShaderPackResourceStream(s); if (inputstream != null) { MetadataSerializer metadataserializer = METADATA_SERIALIZER; BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream)); TextureMetadataSection texturemetadatasection1; try { JsonObject jsonobject = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); TextureMetadataSection texturemetadatasection = (TextureMetadataSection)metadataserializer.parseMetadataSection(s1, jsonobject); if (texturemetadatasection == null) { return new TextureMetadataSection(false, false); } texturemetadatasection1 = texturemetadatasection; } catch (RuntimeException runtimeexception) { SMCLog.warning("Error reading metadata: " + s); SMCLog.warning("" + runtimeexception.getClass().getName() + ": " + runtimeexception.getMessage()); return new TextureMetadataSection(false, false); } finally { IOUtils.closeQuietly((Reader)bufferedreader); IOUtils.closeQuietly(inputstream); } return texturemetadatasection1; } else { return new TextureMetadataSection(false, false); } }
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;
public FallbackResourceManager(MetadataSerializer frmMetadataSerializerIn) { this.frmMetadataSerializer = frmMetadataSerializerIn; }
public LanguageManager(MetadataSerializer theMetadataSerializerIn, String currentLanguageIn) { this.theMetadataSerializer = theMetadataSerializerIn; this.currentLanguage = currentLanguageIn; I18n.setLocale(CURRENT_LOCALE); }
@Nullable public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return this.field_191383_a.getPackMetadata(metadataSerializer, metadataSectionName); }
public SimpleReloadableResourceManager(MetadataSerializer rmMetadataSerializerIn) { this.rmMetadataSerializer = rmMetadataSerializerIn; }
@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; }
public SimpleResource(ResourceLocation p_i1300_1_, InputStream p_i1300_2_, InputStream p_i1300_3_, MetadataSerializer p_i1300_4_) { this.field_110533_b = p_i1300_1_; this.field_110534_c = p_i1300_2_; this.field_110531_d = p_i1300_3_; this.field_110532_e = p_i1300_4_; }
public MetadataSection func_135058_a(MetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return func_110596_a(p_135058_1_, this.func_110591_a("pack.mcmeta"), p_135058_2_); }