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


Java IMetadataSection类代码示例

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


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

示例1: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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.IMetadataSection; //导入依赖的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: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例4: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例5: readMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例6: readMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例7: readMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例8: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例9: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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

示例10: getMetadata

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

示例11: getPackMetadata

import net.minecraft.client.resources.data.IMetadataSection; //导入依赖的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.IMetadataSection; //导入依赖的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: getMetadata

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

示例14: getMetadata

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

示例15: parseMetadataSection

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


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