本文整理汇总了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;
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}