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