Java 类net.minecraft.client.resources.data.MetadataSerializer 实例源码

项目:Backmemed    文件:DefaultResourcePack.java   
@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);
    }
}
项目:CustomWorldGen    文件:DefaultResourcePack.java   
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;
    }
}
项目:MineLittlePony    文件:MineLittlePony.java   
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");
}
项目:ExpandedRailsMod    文件:AbstractResourcePack.java   
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);
}
项目:ExpandedRailsMod    文件:DefaultResourcePack.java   
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;
    }
}
项目:RuneCraftery    文件:ResourcePackRepository.java   
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);
      }
   }

}
项目:RuneCraftery    文件:AbstractResourcePack.java   
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);
}
项目:RuneCraftery    文件:ResourcePackRepository.java   
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);
        }
    }
}
项目:BetterNutritionMod    文件:AbstractResourcePack.java   
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);
}
项目:BetterNutritionMod    文件:ResourcePackRepository.java   
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);
        }
    }
}
项目:Backmemed    文件:SimpleShaderTexture.java   
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;
}
项目:Backmemed    文件:SimpleResource.java   
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;
}
项目:Backmemed    文件:ResourcePackRepository.java   
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()});
            }
        }
    }
}
项目:CustomWorldGen    文件:SimpleResource.java   
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;
}
项目:CustomWorldGen    文件:ResourcePackRepository.java   
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()});
            }
        }
    }
}
项目:InspiringWorld    文件:ExternalResource.java   
@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);
}
项目:ExpandedRailsMod    文件:SimpleResource.java   
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;
}
项目:ExpandedRailsMod    文件:ResourcePackRepository.java   
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()});
            }
        }
    }
}
项目:RuneCraftery    文件:AbstractResourcePack.java   
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);
}
项目:RuneCraftery    文件:SimpleResource.java   
public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, MetadataSerializer par4MetadataSerializer)
{
    this.srResourceLocation = par1ResourceLocation;
    this.resourceInputStream = par2InputStream;
    this.mcmetaInputStream = par3InputStream;
    this.srMetadataSerializer = par4MetadataSerializer;
}
项目:BetterNutritionMod    文件:SimpleResource.java   
public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, MetadataSerializer par4MetadataSerializer)
{
    this.srResourceLocation = par1ResourceLocation;
    this.resourceInputStream = par2InputStream;
    this.mcmetaInputStream = par3InputStream;
    this.srMetadataSerializer = par4MetadataSerializer;
}
项目:Backmemed    文件:SimpleShaderTexture.java   
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);
    }
}
项目:Backmemed    文件:AbstractResourcePack.java   
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException
{
    return readMetadata(metadataSerializer, this.getInputStreamByName("pack.mcmeta"), metadataSectionName);
}
项目:Backmemed    文件:IResourcePack.java   
@Nullable
<T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException;
项目:Backmemed    文件:FallbackResourceManager.java   
public FallbackResourceManager(MetadataSerializer frmMetadataSerializerIn)
{
    this.frmMetadataSerializer = frmMetadataSerializerIn;
}
项目:Backmemed    文件:LanguageManager.java   
public LanguageManager(MetadataSerializer theMetadataSerializerIn, String currentLanguageIn)
{
    this.theMetadataSerializer = theMetadataSerializerIn;
    this.currentLanguage = currentLanguageIn;
    I18n.setLocale(CURRENT_LOCALE);
}
项目:Backmemed    文件:LegacyV2Adapter.java   
@Nullable
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException
{
    return this.field_191383_a.getPackMetadata(metadataSerializer, metadataSectionName);
}
项目:Backmemed    文件:SimpleReloadableResourceManager.java   
public SimpleReloadableResourceManager(MetadataSerializer rmMetadataSerializerIn)
{
    this.rmMetadataSerializer = rmMetadataSerializerIn;
}
项目:CustomWorldGen    文件:AbstractResourcePack.java   
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException
{
    return readMetadata(metadataSerializer, this.getInputStreamByName("pack.mcmeta"), metadataSectionName);
}
项目:CustomWorldGen    文件:FallbackResourceManager.java   
public FallbackResourceManager(MetadataSerializer frmMetadataSerializerIn)
{
    this.frmMetadataSerializer = frmMetadataSerializerIn;
}
项目:CustomWorldGen    文件:LanguageManager.java   
public LanguageManager(MetadataSerializer theMetadataSerializerIn, String currentLanguageIn)
{
    this.theMetadataSerializer = theMetadataSerializerIn;
    this.currentLanguage = currentLanguageIn;
    I18n.setLocale(CURRENT_LOCALE);
}
项目:CustomWorldGen    文件:SimpleReloadableResourceManager.java   
public SimpleReloadableResourceManager(MetadataSerializer rmMetadataSerializerIn)
{
    this.rmMetadataSerializer = rmMetadataSerializerIn;
}
项目:CustomAchievements    文件:AchievementResourcePack.java   
@Override
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException {
    return null;
}
项目:DynamicSurroundings    文件:ResourcePacks.java   
@Override
@Nullable
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer,
        String metadataSectionName) throws IOException {
    return null;
}
项目:ExpandedRailsMod    文件:AbstractResourcePack.java   
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException
{
    return readMetadata(metadataSerializer, this.getInputStreamByName("pack.mcmeta"), metadataSectionName);
}
项目:ExpandedRailsMod    文件:FallbackResourceManager.java   
public FallbackResourceManager(MetadataSerializer frmMetadataSerializerIn)
{
    this.frmMetadataSerializer = frmMetadataSerializerIn;
}
项目:ExpandedRailsMod    文件:LanguageManager.java   
public LanguageManager(MetadataSerializer theMetadataSerializerIn, String currentLanguageIn)
{
    this.theMetadataSerializer = theMetadataSerializerIn;
    this.currentLanguage = currentLanguageIn;
    I18n.setLocale(CURRENT_LOCALE);
}
项目:ExpandedRailsMod    文件:SimpleReloadableResourceManager.java   
public SimpleReloadableResourceManager(MetadataSerializer rmMetadataSerializerIn)
{
    this.rmMetadataSerializer = rmMetadataSerializerIn;
}
项目:RuneCraftery    文件:SimpleResource.java   
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_;
}
项目:RuneCraftery    文件:AbstractResourcePack.java   
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_);
}