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


Java IMetadataSerializer类代码示例

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


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

示例1: getPackMetadata

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

示例2: getPackMetadata

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

示例3: readMetadata

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

示例4: readMetadata

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

示例5: getPackMetadata

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

示例6: SimpleResource

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

示例7: ResourcePackRepository

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

示例8: load

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

示例9: SimpleResource

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

示例10: ResourcePackRepository

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

示例11: getPackMetadata

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

示例12: getPackMetadata

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

示例13: SimpleResource

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

示例14: ResourcePackRepository

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

示例15: getPackMetadata

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


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