本文整理汇总了Java中net.minecraft.client.resources.Language类的典型用法代码示例。如果您正苦于以下问题:Java Language类的具体用法?Java Language怎么用?Java Language使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Language类属于net.minecraft.client.resources包,在下文中一共展示了Language类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public LanguageMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
Set<Language> set = Sets.<Language>newHashSet();
for (Entry<String, JsonElement> entry : jsonobject.entrySet())
{
String s = (String)entry.getKey();
JsonObject jsonobject1 = JsonUtils.getJsonObject((JsonElement)entry.getValue(), "language");
String s1 = JsonUtils.getString(jsonobject1, "region");
String s2 = JsonUtils.getString(jsonobject1, "name");
boolean flag = JsonUtils.getBoolean(jsonobject1, "bidirectional", false);
if (s1.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + s + "\'->region: empty value");
}
if (s2.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + s + "\'->name: empty value");
}
if (!set.add(new Language(s, s1, s2, flag)))
{
throw new JsonParseException("Duplicate language->\'" + s + "\' defined");
}
}
return new LanguageMetadataSection(set);
}
示例2: List
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public List(Minecraft mcIn)
{
super(mcIn, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18);
for (Language language : GuiLanguage.this.languageManager.getLanguages())
{
this.languageMap.put(language.getLanguageCode(), language);
this.langCodeList.add(language.getLanguageCode());
}
}
示例3: elementClicked
import net.minecraft.client.resources.Language; //导入依赖的package包/类
protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY)
{
Language language = (Language)this.languageMap.get(this.langCodeList.get(slotIndex));
GuiLanguage.this.languageManager.setCurrentLanguage(language);
GuiLanguage.this.game_settings_3.language = language.getLanguageCode();
this.mc.refreshResources();
GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.languageManager.isCurrentLocaleUnicode() || GuiLanguage.this.game_settings_3.forceUnicodeFont);
GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.languageManager.isCurrentLanguageBidirectional());
GuiLanguage.this.confirmSettingsBtn.displayString = I18n.format("gui.done", new Object[0]);
GuiLanguage.this.forceUnicodeFontBtn.displayString = GuiLanguage.this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT);
GuiLanguage.this.game_settings_3.saveOptions();
}
示例4: elementClicked
import net.minecraft.client.resources.Language; //导入依赖的package包/类
/**
* The element in the slot that was clicked, boolean for whether it was double clicked or not
*/
protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY)
{
Language language = (Language)this.languageMap.get(this.langCodeList.get(slotIndex));
GuiLanguage.this.languageManager.setCurrentLanguage(language);
GuiLanguage.this.game_settings_3.language = language.getLanguageCode();
this.mc.refreshResources();
GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.languageManager.isCurrentLocaleUnicode() || GuiLanguage.this.game_settings_3.forceUnicodeFont);
GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.languageManager.isCurrentLanguageBidirectional());
GuiLanguage.this.confirmSettingsBtn.displayString = I18n.format("gui.done", new Object[0]);
GuiLanguage.this.forceUnicodeFontBtn.displayString = GuiLanguage.this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT);
GuiLanguage.this.game_settings_3.saveOptions();
}
示例5: onResourceManagerReload
import net.minecraft.client.resources.Language; //导入依赖的package包/类
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
Language language = FMLClientHandler.instance().getClient().getLanguageManager().getCurrentLanguage();
String lang = language.getJavaLocale().getLanguage();
ModLogger.info("Loading guide text... ("+lang+")");
GuidePages.loadGuideText(lang);
ModLogger.info("("+GuidePages.CHAPTERTEXT.size()+") chapters loaded.");
}
示例6: deserialize
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public LanguageMetadataSection deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext)
{
JsonObject var4 = par1JsonElement.getAsJsonObject();
HashSet var5 = Sets.newHashSet();
Iterator var6 = var4.entrySet().iterator();
String var8;
String var10;
String var11;
boolean var12;
do
{
if (!var6.hasNext())
{
return new LanguageMetadataSection(var5);
}
Entry var7 = (Entry)var6.next();
var8 = (String)var7.getKey();
JsonObject var9 = JsonUtils.getJsonElementAsJsonObject((JsonElement)var7.getValue(), "language");
var10 = JsonUtils.getJsonObjectStringFieldValue(var9, "region");
var11 = JsonUtils.getJsonObjectStringFieldValue(var9, "name");
var12 = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var9, "bidirectional", false);
if (var10.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value");
}
if (var11.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value");
}
}
while (var5.add(new Language(var8, var10, var11, var12)));
throw new JsonParseException("Duplicate language->\'" + var8 + "\' defined");
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:39,代码来源:LanguageMetadataSectionSerializer.java
示例7: List
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public List()
{
super(GuiLanguage.this.mc, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18);
Iterator var2 = GuiLanguage.this.field_146454_h.getLanguages().iterator();
while (var2.hasNext())
{
Language var3 = (Language)var2.next();
this.field_148177_m.put(var3.getLanguageCode(), var3);
this.field_148176_l.add(var3.getLanguageCode());
}
}
示例8: elementClicked
import net.minecraft.client.resources.Language; //导入依赖的package包/类
protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_)
{
Language var5 = (Language)this.field_148177_m.get(this.field_148176_l.get(p_148144_1_));
GuiLanguage.this.field_146454_h.setCurrentLanguage(var5);
GuiLanguage.this.field_146451_g.language = var5.getLanguageCode();
GuiLanguage.this.mc.refreshResources();
GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.field_146454_h.isCurrentLocaleUnicode() || GuiLanguage.this.field_146451_g.forceUnicodeFont);
GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.isCurrentLanguageBidirectional());
GuiLanguage.this.field_146452_r.displayString = I18n.format("gui.done", new Object[0]);
GuiLanguage.this.field_146455_i.displayString = GuiLanguage.this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT);
GuiLanguage.this.field_146451_g.saveOptions();
}
示例9: deserialize
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public LanguageMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_)
{
JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
HashSet hashset = Sets.newHashSet();
Iterator iterator = jsonobject.entrySet().iterator();
String s;
String s1;
String s2;
boolean flag;
do
{
if (!iterator.hasNext())
{
return new LanguageMetadataSection(hashset);
}
Entry entry = (Entry)iterator.next();
s = (String)entry.getKey();
JsonObject jsonobject1 = JsonUtils.getJsonElementAsJsonObject((JsonElement)entry.getValue(), "language");
s1 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "region");
s2 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "name");
flag = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject1, "bidirectional", false);
if (s1.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + s + "\'->region: empty value");
}
if (s2.isEmpty())
{
throw new JsonParseException("Invalid language->\'" + s + "\'->name: empty value");
}
}
while (hashset.add(new Language(s, s1, s2, flag)));
throw new JsonParseException("Duplicate language->\'" + s + "\' defined");
}
示例10: List
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public List()
{
super(GuiLanguage.this.mc, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18);
Iterator iterator = GuiLanguage.this.field_146454_h.getLanguages().iterator();
while (iterator.hasNext())
{
Language language = (Language)iterator.next();
this.field_148177_m.put(language.getLanguageCode(), language);
this.field_148176_l.add(language.getLanguageCode());
}
}
示例11: elementClicked
import net.minecraft.client.resources.Language; //导入依赖的package包/类
protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_)
{
Language language = (Language)this.field_148177_m.get(this.field_148176_l.get(p_148144_1_));
GuiLanguage.this.field_146454_h.setCurrentLanguage(language);
GuiLanguage.this.field_146451_g.language = language.getLanguageCode();
GuiLanguage.this.mc.refreshResources();
GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.field_146454_h.isCurrentLocaleUnicode() || GuiLanguage.this.field_146451_g.forceUnicodeFont);
GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.isCurrentLanguageBidirectional());
GuiLanguage.this.field_146452_r.displayString = I18n.format("gui.done", new Object[0]);
GuiLanguage.this.field_146455_i.displayString = GuiLanguage.this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT);
GuiLanguage.this.field_146451_g.saveOptions();
}
示例12: func_135020_a
import net.minecraft.client.resources.Language; //导入依赖的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");
}
示例13: func_135043_a
import net.minecraft.client.resources.Language; //导入依赖的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);
}
}
}
示例14: GuiSlotLanguage
import net.minecraft.client.resources.Language; //导入依赖的package包/类
public GuiSlotLanguage(GuiLanguage p_i1042_1_) {
super(p_i1042_1_.field_73882_e, p_i1042_1_.field_73880_f, p_i1042_1_.field_73881_g, 32, p_i1042_1_.field_73881_g - 65 + 4, 18);
this.field_77252_a = p_i1042_1_;
this.field_77251_g = Lists.newArrayList();
this.field_77253_h = Maps.newHashMap();
Iterator var2 = GuiLanguage.func_135011_a(p_i1042_1_).func_135040_d().iterator();
while(var2.hasNext()) {
Language var3 = (Language)var2.next();
this.field_77253_h.put(var3.func_135034_a(), var3);
this.field_77251_g.add(var3.func_135034_a());
}
}
示例15: func_77213_a
import net.minecraft.client.resources.Language; //导入依赖的package包/类
protected void func_77213_a(int p_77213_1_, boolean p_77213_2_) {
Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(p_77213_1_));
GuiLanguage.func_135011_a(this.field_77252_a).func_135045_a(var3);
GuiLanguage.func_74043_a(this.field_77252_a).field_74363_ab = var3.func_135034_a();
this.field_77252_a.field_73882_e.func_110436_a();
this.field_77252_a.field_73886_k.func_78264_a(GuiLanguage.func_135011_a(this.field_77252_a).func_135042_a());
this.field_77252_a.field_73886_k.func_78275_b(GuiLanguage.func_135011_a(this.field_77252_a).func_135044_b());
GuiLanguage.func_74042_b(this.field_77252_a).field_73744_e = I18n.func_135053_a("gui.done");
GuiLanguage.func_74043_a(this.field_77252_a).func_74303_b();
}