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

The following examples show how to use net.minecraft.util.StatCollector#translateToLocalFormatted() . 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: SJStringHelper.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
public static String localize(String unlocalized, boolean prefix, Object... args) {
    String toLocalize = (prefix ? SimplyJetpacks.PREFIX : "") + unlocalized;
    if (args != null && args.length > 0) {
        return StatCollector.translateToLocalFormatted(toLocalize, args);
    } else {
        return StatCollector.translateToLocal(toLocalize);
    }
}
 
Example 2
Source File: Option.java    From NotEnoughItems with MIT License 4 votes vote down vote up
public String translateN(String s, Object... args) {
    return StatCollector.translateToLocalFormatted(namespaced(s), args);
}
 
Example 3
Source File: JSHandler.java    From OmniOcular with Apache License 2.0 4 votes vote down vote up
public static String translateFormatted(String t, Object[] format) {
    return StatCollector.translateToLocalFormatted(t, format);
}
 
Example 4
Source File: LangProxy.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public String format(String key, Object... params) {
    return StatCollector.translateToLocalFormatted(namespace+key, params);
}