Java Code Examples for net.minecraft.util.StatCollector#translateToLocal()

The following examples show how to use net.minecraft.util.StatCollector#translateToLocal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PacketTCNotificationText.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public IMessage onMessage(PacketTCNotificationText message, MessageContext ctx) {
    if(message.text == null) return null;
    String translated = StatCollector.translateToLocal(message.text);
    ResourceLocation image = null;
    int color = message.color;
    Aspect a = Aspect.getAspect(message.additionalInfo);
    if(a != null) {
        image = a.getImage();
        color = a.getColor();
    }
    if(message.text.equals("gadomancy.aura.research.unlock")) {
        if(a != null) {
            translated = EnumChatFormatting.GREEN + String.format(translated, a.getName());
        } else {
            translated = EnumChatFormatting.GREEN + String.format(translated, message.additionalInfo);
        }
    }
    color &= 0xFFFFFF;
    PlayerNotifications.addNotification(translated, image, color);
    return null;
}
 
Example 2
Source File: TT_MetaTileEntity_Pipe_Energy_LowPower.java    From bartworks with MIT License 5 votes vote down vote up
@Override
public String[] getDescription() {
    return new String[]{
            "Primitive Laser Cable intended for Low Power Applications",
            "Does not auto-connect",
            "Does not turn or bend",
            ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work",
            StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
    };
}
 
Example 3
Source File: ResearchPage.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
/**
 * returns a localized text of the text field (if one exists). Returns the text field itself otherwise.
 * @return
 */
public String getTranslatedText() {
	String ret="";
	if (text != null) {
		ret = StatCollector.translateToLocal(text);
		if (ret.isEmpty()) ret = text;
	}
	return ret;
}
 
Example 4
Source File: ItemEntityEgg.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@Override
public String getItemStackDisplayName(ItemStack stack) {
	String s = ("" + StatCollector.translateToLocal(Items.spawn_egg.getUnlocalizedName() + ".name")).trim();
	String s1 = ModEntityList.getName(stack.getItemDamage());

	if (s1 != null)
		s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");

	return s;
}
 
Example 5
Source File: GT_TileEntity_Windmill.java    From bartworks with MIT License 5 votes vote down vote up
@Override
public String[] getDescription() {
    String[] dsc = StatCollector.translateToLocal("tooltip.tile.windmill.0.name").split(";");
    String[] fdsc = new String[dsc.length + 1];
    for (int i = 0; i < dsc.length; i++) {
        fdsc[i] = dsc[i];
        fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks";
    }
    return fdsc;
}
 
Example 6
Source File: TileEntityAutoChisel.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
public String getLocalizedName() {
	return StatCollector.translateToLocal(getUnlocalizedName() + ".name");
}
 
Example 7
Source File: ItemCasing.java    From ExtraCells1 with MIT License 4 votes vote down vote up
@Override
public String getItemDisplayName(ItemStack itemstack)
{
	return StatCollector.translateToLocal(this.getUnlocalizedName(itemstack));
}
 
Example 8
Source File: FocusUpgradeType.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
public String getLocalizedText() {
	return StatCollector.translateToLocal(text);
}
 
Example 9
Source File: ResearchItem.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
public String getName()
{
	return StatCollector.translateToLocal("tc.research_name."+key);
}
 
Example 10
Source File: FocusUpgradeType.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
public String getLocalizedName() {
	return StatCollector.translateToLocal(name);
}
 
Example 11
Source File: BW_WorldGenRoss128b.java    From bartworks with MIT License 4 votes vote down vote up
public static void initundergroundFluids() {
    String ross128b = StatCollector.translateToLocal("planet.Ross128b");
    uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5);
    uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5);
    uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5);
}
 
Example 12
Source File: FocusUpgradeType.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
public String getLocalizedText() {
	return StatCollector.translateToLocal(text);
}
 
Example 13
Source File: Utils.java    From NEI-Integration with MIT License 4 votes vote down vote up
public static String translate(String unlocalized, boolean prefix) {
    return StatCollector.translateToLocal((prefix ? "neiintegration." : "") + unlocalized);
}
 
Example 14
Source File: FocusUpgradeType.java    From GardenCollection with MIT License 4 votes vote down vote up
public String getLocalizedText() {
	return StatCollector.translateToLocal(text);
}
 
Example 15
Source File: SubTileGenerating.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 4 votes vote down vote up
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
	String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name");
	int color = getColor();
	BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
}
 
Example 16
Source File: ItemStorageComponent.java    From ExtraCells1 with MIT License 4 votes vote down vote up
@Override
public String getItemDisplayName(ItemStack itemstack)
{
	return StatCollector.translateToLocal(getUnlocalizedName(itemstack));
}
 
Example 17
Source File: ItemWirelessTriangulator.java    From WirelessRedstone with MIT License 4 votes vote down vote up
public String getGuiName() {
    return StatCollector.translateToLocal("item.wrcbe_addons:triangulator.name");
}
 
Example 18
Source File: ResearchItem.java    From GardenCollection with MIT License 4 votes vote down vote up
public String getText()
{
	return StatCollector.translateToLocal("tc.research_text."+key);
}
 
Example 19
Source File: ReceiverPart.java    From WirelessRedstone with MIT License 4 votes vote down vote up
public String getGuiName()
{
    return StatCollector.translateToLocal("item.wrcbe_logic:wirelesspart|1.name");
}
 
Example 20
Source File: ResearchCategories.java    From Chisel-2 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param key
 * @return the name of the research category linked to this key. 
 * Must be stored as localization information in the LanguageRegistry.
 */
public static String getCategoryName(String key) {
	return StatCollector.translateToLocal("tc.research_category."+key);
}