本文整理匯總了Java中net.minecraft.util.text.translation.I18n.translateToLocalFormatted方法的典型用法代碼示例。如果您正苦於以下問題:Java I18n.translateToLocalFormatted方法的具體用法?Java I18n.translateToLocalFormatted怎麽用?Java I18n.translateToLocalFormatted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.util.text.translation.I18n
的用法示例。
在下文中一共展示了I18n.translateToLocalFormatted方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
@Nonnull
public String getItemStackDisplayName(@Nonnull ItemStack stack)
{
FluidStack fluidStack = getFluid(stack);
if (fluidStack == null)
{
return super.getItemStackDisplayName(stack);
}
String unloc = this.getUnlocalizedNameInefficiently(stack);
if (I18n.canTranslate(unloc + "." + fluidStack.getFluid().getName()))
{
return I18n.translateToLocal(unloc + "." + fluidStack.getFluid().getName());
}
return I18n.translateToLocalFormatted(unloc + ".filled.name", fluidStack.getLocalizedName());
}
示例2: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
public String getItemStackDisplayName(ItemStack stack)
{
if (stack.getMetadata() == 3 && stack.hasTagCompound())
{
if (stack.getTagCompound().hasKey("SkullOwner", 8))
{
return I18n.translateToLocalFormatted("item.skull.player.name", new Object[] {stack.getTagCompound().getString("SkullOwner")});
}
if (stack.getTagCompound().hasKey("SkullOwner", 10))
{
NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("SkullOwner");
if (nbttagcompound.hasKey("Name", 8))
{
return I18n.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")});
}
}
}
return super.getItemStackDisplayName(stack);
}
示例3: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack)
{
FluidStack fluidStack = getFluid(stack);
if (fluidStack == null)
{
if(getEmpty() != null)
{
return getEmpty().getDisplayName();
}
return super.getItemStackDisplayName(stack);
}
String unloc = this.getUnlocalizedNameInefficiently(stack);
if (I18n.canTranslate(unloc + "." + fluidStack.getFluid().getName()))
{
return I18n.translateToLocal(unloc + "." + fluidStack.getFluid().getName());
}
return I18n.translateToLocalFormatted(unloc + ".name", fluidStack.getLocalizedName());
}
示例4: getLocalizedName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public String getLocalizedName(ItemStack stack) {
EnumDyeColor color = this.getStateFromMeta(stack.getItemDamage()).getValue(BlockColored.COLOR);
String localColor = I18n.translateToLocal("color."+color.getUnlocalizedName());
return I18n.translateToLocalFormatted(getUnlocalizedName()+".name", localColor);
}
示例5: handleFluidTanks
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
public static void handleFluidTanks(ProbeMode mode, IProbeInfo probeInfo, IFluidHandler handler) {
int n = 1;
for (IFluidTankProperties properties : handler.getTankProperties()) {
FluidStack fluidStack = properties.getContents();
String fluidDesc = fluidStack == null ? I18n.translateToLocalFormatted("gui.liquid.empty") : fluidStack.amount + "mB " + fluidStack.getLocalizedName();
probeInfo.text(I18n.translateToLocalFormatted("waila.fluid", n++, fluidDesc));
}
}
示例6: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack) {
FluidStack fluid = FluidUtil.getFluidContained(stack);
if(fluid != null)
return I18n.translateToLocalFormatted("item.mug.name",fluid.getLocalizedName());
else
return I18n.translateToLocal("item.mug.empty.name");
}
示例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: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack) {
String localizedRockName = I18n.translateToLocal(block.getUnlocalizedName()+".name");
return I18n.translateToLocalFormatted("thermionics_world.brickvariety."+stack.getItemDamage(), localizedRockName);
}
示例9: localize
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
public static String localize(String input, Object... format)
{
return I18n.translateToLocalFormatted(input, format);
}
示例10: getDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
public String getDisplayName()
{
return I18n.translateToLocalFormatted("sip." + name + ".name");
}
示例11: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return I18n.translateToLocalFormatted(getUnlocalizedName() + ".name", PurMag.INSTANCE.getSipRegistry().getType(SipUtils.getSipInStack(stack)).getDisplayName());
}
示例12: getItemStackDisplayName
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return I18n.translateToLocalFormatted(getUnlocalizedName() + (stack.getMetadata() == 0 ? ".lockable" : ".not_lockable") + ".name");
}
示例13: format
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
@Nonnull
static String format(String key, Object... params) {
return I18n.canTranslate(key) ? I18n.translateToLocalFormatted(key, params) : String.format(Locale.US, I18n.translateToFallback(key), params);
}
示例14: format
import net.minecraft.util.text.translation.I18n; //導入方法依賴的package包/類
public static String format(String key, Object... args)
{
return I18n.translateToLocalFormatted(key, args);
}