Java Code Examples for net.minecraft.util.text.TextComponentTranslation.getFormattedText()

The following are Jave code examples for showing how to use getFormattedText() of the net.minecraft.util.text.TextComponentTranslation class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Bewitchment   File: ItemBrew.java   Source Code and License Vote up 5 votes
@Override
public String getItemStackDisplayName(ItemStack stack) {
	if (NBTHelper.hasTag(stack, BrewUtils.BREW_NAME)) {
		TextComponentTranslation text = new TextComponentTranslation(NBTHelper.getString(stack, BrewUtils.BREW_NAME));
		return text.getFormattedText();
	}
	return super.getItemStackDisplayName(stack);
}
 
Example 2
Project: ChatBomb   File: LangUtility.java   Source Code and License Vote up 4 votes
public static String getTranslation(String translationKey) {
    TextComponentTranslation desc = new TextComponentTranslation(translationKey);
    return desc.getFormattedText();
}