当前位置: 首页>>代码示例>>Java>>正文


Java MetadataSerializer类代码示例

本文整理汇总了Java中net.minecraft.client.resources.data.MetadataSerializer的典型用法代码示例。如果您正苦于以下问题:Java MetadataSerializer类的具体用法?Java MetadataSerializer怎么用?Java MetadataSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MetadataSerializer类属于net.minecraft.client.resources.data包,在下文中一共展示了MetadataSerializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPackMetadata

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:DefaultResourcePack.java

示例2: getPackMetadata

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:DefaultResourcePack.java

示例3: init

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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");
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:18,代码来源:MineLittlePony.java

示例4: readMetadata

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:22,代码来源:AbstractResourcePack.java

示例5: ResourcePackRepository

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:17,代码来源:ResourcePackRepository.java

示例6: readMetadata

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:18,代码来源:AbstractResourcePack.java

示例7: ResourcePackRepository

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:20,代码来源:ResourcePackRepository.java

示例8: makeMetadataSerializer

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:SimpleShaderTexture.java

示例9: SimpleResource

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SimpleResource.java

示例10: ResourcePackRepository

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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()});
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:ResourcePackRepository.java

示例11: ResourcePackRepository

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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()});
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:31,代码来源:ResourcePackRepository.java

示例12: getPackMetadata

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
@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);
}
 
开发者ID:InfinityStudio,项目名称:InspiringWorld,代码行数:35,代码来源:ExternalResource.java

示例13: func_110596_a

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:14,代码来源:AbstractResourcePack.java

示例14: SimpleResource

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, MetadataSerializer par4MetadataSerializer)
{
    this.srResourceLocation = par1ResourceLocation;
    this.resourceInputStream = par2InputStream;
    this.mcmetaInputStream = par3InputStream;
    this.srMetadataSerializer = par4MetadataSerializer;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:SimpleResource.java

示例15: loadTextureMetadataSection

import net.minecraft.client.resources.data.MetadataSerializer; //导入依赖的package包/类
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);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:44,代码来源:SimpleShaderTexture.java


注:本文中的net.minecraft.client.resources.data.MetadataSerializer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。