Class L10NHelpers

java.lang.Object
org.cyclops.cyclopscore.helper.L10NHelpers

public final class L10NHelpers extends Object
A set of localization helpers.
  • Field Details

    • MAX_TOOLTIP_LINE_LENGTH

      public static final int MAX_TOOLTIP_LINE_LENGTH
      See Also:
  • Constructor Details

    • L10NHelpers

      public L10NHelpers()
  • Method Details

    • localize

      public static String localize(String key, Object... params)
      Localize a key that has values in language files.
      Parameters:
      key - The key of the language file entry.
      params - The parameters of the formatting
      Returns:
      The localized string.
    • addStatusInfo

      public static void addStatusInfo(List<net.minecraft.network.chat.Component> infoLines, boolean isEnabled, String statusPrefixKey)
      Show status info about the activation about an item to the info box.
      Parameters:
      infoLines - The list to add info to.
      isEnabled - If the item is enabled.
      statusPrefixKey - The prefix for the l10n key that will show if it is enabled, this should be a formatted string with one parameter.
    • addOptionalInfo

      public static void addOptionalInfo(List<net.minecraft.network.chat.Component> list, String prefix)
      Add the optional info lines to the item tooltip.
      Parameters:
      list - The list to add the lines to.
      prefix - The I18N key prefix, being the unlocalized name of blocks or items.