本文整理汇总了Java中net.minecraft.client.resources.data.LanguageMetadataSection类的典型用法代码示例。如果您正苦于以下问题:Java LanguageMetadataSection类的具体用法?Java LanguageMetadataSection怎么用?Java LanguageMetadataSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LanguageMetadataSection类属于net.minecraft.client.resources.data包,在下文中一共展示了LanguageMetadataSection类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List<IResourcePack> p_135043_1_)
{
this.languageMap.clear();
for (IResourcePack iresourcepack : p_135043_1_)
{
try
{
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language");
if (languagemetadatasection != null)
{
for (Language language : languagemetadatasection.getLanguages())
{
if (!this.languageMap.containsKey(language.getLanguageCode()))
{
this.languageMap.put(language.getLanguageCode(), language);
}
}
}
}
catch (RuntimeException runtimeexception)
{
logger.warn((String)("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName()), (Throwable)runtimeexception);
}
catch (IOException ioexception)
{
logger.warn((String)("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName()), (Throwable)ioexception);
}
}
}
示例2: registerMetadataSerializers
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
private void registerMetadataSerializers()
{
this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
}
示例3: registerMetadataSerializers
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
private void registerMetadataSerializers() {
this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(),
TextureMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(),
FontMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(),
AnimationMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(),
PackMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(),
LanguageMetadataSection.class);
}
示例4: makeMetadataSerializer
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的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;
}
示例5: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List<IResourcePack> resourcesPacks)
{
this.languageMap.clear();
for (IResourcePack iresourcepack : resourcesPacks)
{
try
{
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language");
if (languagemetadatasection != null)
{
for (Language language : languagemetadatasection.getLanguages())
{
if (!this.languageMap.containsKey(language.getLanguageCode()))
{
this.languageMap.put(language.getLanguageCode(), language);
}
}
}
}
catch (RuntimeException runtimeexception)
{
LOGGER.warn("Unable to parse language metadata section of resourcepack: {}", new Object[] {iresourcepack.getPackName(), runtimeexception});
}
catch (IOException ioexception)
{
LOGGER.warn("Unable to parse language metadata section of resourcepack: {}", new Object[] {iresourcepack.getPackName(), ioexception});
}
}
}
示例6: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List<IResourcePack> resourcesPacks)
{
this.languageMap.clear();
for (IResourcePack iresourcepack : resourcesPacks)
{
try
{
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language");
if (languagemetadatasection != null)
{
for (Language language : languagemetadatasection.getLanguages())
{
if (!this.languageMap.containsKey(language.getLanguageCode()))
{
this.languageMap.put(language.getLanguageCode(), language);
}
}
}
}
catch (RuntimeException runtimeexception)
{
LOGGER.warn("Unable to parse metadata section of resourcepack: {}", new Object[] {iresourcepack.getPackName(), runtimeexception});
}
catch (IOException ioexception)
{
LOGGER.warn("Unable to parse metadata section of resourcepack: {}", new Object[] {iresourcepack.getPackName(), ioexception});
}
}
}
示例7: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List par1List)
{
this.languageMap.clear();
Iterator var2 = par1List.iterator();
while (var2.hasNext())
{
IResourcePack var3 = (IResourcePack)var2.next();
try
{
LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.theMetadataSerializer, "language");
if (var4 != null)
{
Iterator var5 = var4.getLanguages().iterator();
while (var5.hasNext())
{
Language var6 = (Language)var5.next();
if (!this.languageMap.containsKey(var6.getLanguageCode()))
{
this.languageMap.put(var6.getLanguageCode(), var6);
}
}
}
}
catch (RuntimeException var7)
{
logger.warn("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var7);
}
catch (IOException var8)
{
logger.warn("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8);
}
}
}
示例8: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List p_135043_1_)
{
this.languageMap.clear();
Iterator iterator = p_135043_1_.iterator();
while (iterator.hasNext())
{
IResourcePack iresourcepack = (IResourcePack)iterator.next();
try
{
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language");
if (languagemetadatasection != null)
{
Iterator iterator1 = languagemetadatasection.getLanguages().iterator();
while (iterator1.hasNext())
{
Language language = (Language)iterator1.next();
if (!this.languageMap.containsKey(language.getLanguageCode()))
{
this.languageMap.put(language.getLanguageCode(), language);
}
}
}
}
catch (RuntimeException runtimeexception)
{
logger.warn("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName(), runtimeexception);
}
catch (IOException ioexception)
{
logger.warn("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName(), ioexception);
}
}
}
示例9: func_135020_a
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public LanguageMetadataSection func_135020_a(JsonElement p_135020_1_, Type p_135020_2_, JsonDeserializationContext p_135020_3_) {
JsonObject var4 = p_135020_1_.getAsJsonObject();
HashSet var5 = Sets.newHashSet();
Iterator var6 = var4.entrySet().iterator();
String var8;
String var11;
String var12;
boolean var13;
do {
if(!var6.hasNext()) {
return new LanguageMetadataSection(var5);
}
Entry var7 = (Entry)var6.next();
var8 = (String)var7.getKey();
JsonElement var9 = (JsonElement)var7.getValue();
if(!var9.isJsonObject()) {
throw new JsonParseException("Invalid language->\'" + var8 + "\': expected object, was " + var9);
}
JsonObject var10 = var9.getAsJsonObject();
var11 = this.func_110486_a(var10.get("region"), "region", "", 0, Integer.MAX_VALUE);
var12 = this.func_110486_a(var10.get("name"), "name", "", 0, Integer.MAX_VALUE);
var13 = this.func_110484_a(var10.get("bidirectional"), "bidirectional", Boolean.valueOf(false));
if(var11.isEmpty()) {
throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value");
}
if(var12.isEmpty()) {
throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value");
}
} while(var5.add(new Language(var8, var11, var12, var13)));
throw new JsonParseException("Duplicate language->\'" + var8 + "\' defined");
}
示例10: func_135043_a
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void func_135043_a(List p_135043_1_) {
this.field_135046_d.clear();
Iterator var2 = p_135043_1_.iterator();
while(var2.hasNext()) {
ResourcePack var3 = (ResourcePack)var2.next();
try {
LanguageMetadataSection var4 = (LanguageMetadataSection)var3.func_135058_a(this.field_135047_b, "language");
if(var4 != null) {
Iterator var5 = var4.func_135018_a().iterator();
while(var5.hasNext()) {
Language var6 = (Language)var5.next();
if(!this.field_135046_d.containsKey(var6.func_135034_a())) {
this.field_135046_d.put(var6.func_135034_a(), var6);
}
}
}
} catch (RuntimeException var7) {
Minecraft.func_71410_x().func_98033_al().func_98235_b("Unable to parse metadata section of resourcepack: " + var3.func_130077_b(), var7);
} catch (IOException var8) {
Minecraft.func_71410_x().func_98033_al().func_98235_b("Unable to parse metadata section of resourcepack: " + var3.func_130077_b(), var8);
}
}
}
示例11: parseLanguageMetadata
import net.minecraft.client.resources.data.LanguageMetadataSection; //导入依赖的package包/类
public void parseLanguageMetadata(List par1List)
{
this.languageMap.clear();
Iterator iterator = par1List.iterator();
while (iterator.hasNext())
{
ResourcePack resourcepack = (ResourcePack)iterator.next();
try
{
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)resourcepack.getPackMetadata(this.field_135047_b, "language");
if (languagemetadatasection != null)
{
Iterator iterator1 = languagemetadatasection.getLanguages().iterator();
while (iterator1.hasNext())
{
Language language = (Language)iterator1.next();
if (!this.languageMap.containsKey(language.getLanguageCode()))
{
this.languageMap.put(language.getLanguageCode(), language);
}
}
}
}
catch (RuntimeException runtimeexception)
{
Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + resourcepack.getPackName(), runtimeexception);
}
catch (IOException ioexception)
{
Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + resourcepack.getPackName(), ioexception);
}
}
}