本文整理汇总了Java中net.minecraft.util.text.translation.I18n.translateToLocal方法的典型用法代码示例。如果您正苦于以下问题:Java I18n.translateToLocal方法的具体用法?Java I18n.translateToLocal怎么用?Java I18n.translateToLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.text.translation.I18n
的用法示例。
在下文中一共展示了I18n.translateToLocal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public String getItemStackDisplayName(ItemStack p_77653_1_) {
// (I18n.translateToLocal(this.getUnlocalizedName()+".name")).trim();
int i = p_77653_1_.getItemDamage() / 2;
String s1 = "sentry";
switch (i) {
case 10:
s1 = "dispenser";
break;
case 11:
s1 = "teleporter";
break;
}
return I18n.translateToLocal(this.getUnlocalizedName() + "." + s1 + ".name");
}
示例2: initGui
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
@Override
public void initGui()
{
super.initGui();
trackListBottom -= 22;
trackList = new GuiTrackList(this, 158, ySize - 22, guiTop + 17, trackListBottom, guiLeft + 7, 8, playlistView ? playlist : tracks);
this.mc.player.openContainer = this.containerInstrumentPlayer;
for(GuiButton btn : buttonList)
{
if(btn.id == ID_CONFIRM)
{
btn.displayString = I18n.translateToLocal("gui.done");
}
}
}
示例3: getName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Get the name of this object. For players this returns their username
*/
public String getName()
{
if (this.hasCustomName())
{
return this.getCustomNameTag();
}
else
{
String s = EntityList.getEntityString(this);
if (s == null)
{
s = "generic";
}
return I18n.translateToLocal("entity." + s + ".name");
}
}
示例4: translate
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Attempts to a translate a given string/key using the local language, and then
* using the fallback language
* @param msg String or language key to translate
* @return Translated or same string
*/
public static String translate(String msg)
{
return I18n.canTranslate(msg)
? I18n.translateToLocal(msg)
: I18n.translateToFallback(msg);
}
示例5: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
public String getItemStackDisplayName(ItemStack stack)
{
String s = ("" + I18n.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
String s1 = getEntityIdFromItem(stack);
if (s1 != null)
{
s = s + " " + I18n.translateToLocal("entity." + s1 + ".name");
}
return s;
}
示例6: getTranslatedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Returns the correct traslated name of the enchantment and the level in roman numbers.
*/
public String getTranslatedName(int level)
{
String s = I18n.translateToLocal(this.getName());
if (this.func_190936_d())
{
s = TextFormatting.RED + s;
}
return level == 1 && this.getMaxLevel() == 1 ? s : s + " " + I18n.translateToLocal("enchantment.level." + level);
}
示例7: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
@Override
public String getItemStackDisplayName(ItemStack stack) {
EnumDyeColor color = this.getStateForItem(stack).getValue(BlockColored.COLOR);
String localColor = I18n.translateToLocal("color."+color.getUnlocalizedName());
return I18n.translateToLocalFormatted(block.getUnlocalizedName()+".name", localColor);
}
示例8: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Gets the localized name of this block. Used for the statistics page.
*/
public String getLocalizedName()
{
return I18n.translateToLocal("item.brewingStand.name");
}
示例9: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
@Override
public String getLocalizedName(ItemStack stack) {
return I18n.translateToLocal(this.getUnlocalizedName(stack));
}
示例10: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Gets the localized name of this block. Used for the statistics page.
*/
public String getLocalizedName()
{
return I18n.translateToLocal(this.getUnlocalizedName() + "." + BlockStone.EnumType.STONE.getUnlocalizedName() + ".name");
}
示例11: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Gets the localized name of this block. Used for the statistics page.
*/
public String getLocalizedName()
{
return I18n.translateToLocal(this.getUnlocalizedName() + ".dry.name");
}
示例12: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
public String getItemStackDisplayName(ItemStack stack)
{
return I18n.translateToLocal(PotionUtils.getPotionFromItem(stack).getNamePrefixed("splash_potion.effect."));
}
示例13: getUnlocalizedNameInefficiently
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the
* unlocalized name itself is returned.
*/
public String getUnlocalizedNameInefficiently(ItemStack stack)
{
String s = this.getUnlocalizedName(stack);
return s == null ? "" : I18n.translateToLocal(s);
}
示例14: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Gets the localized name of this block. Used for the statistics page.
*/
public String getLocalizedName()
{
return I18n.translateToLocal(this.getUnlocalizedName() + ".name");
}
示例15: getLocalizedName
import net.minecraft.util.text.translation.I18n; //导入方法依赖的package包/类
/**
* Gets the localized name of this block. Used for the statistics page.
*/
public String getLocalizedName()
{
return I18n.translateToLocal(this.getUnlocalizedName() + ".red_sandstone.name");
}