Package org.cyclops.cyclopscore.helper
Class L10NHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.L10NHelpers
A set of localization helpers.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addOptionalInfo
(List<net.minecraft.network.chat.Component> list, String prefix) Add the optional info lines to the item tooltip.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.static String
Localize a key that has values in language files.
-
Field Details
-
MAX_TOOLTIP_LINE_LENGTH
public static final int MAX_TOOLTIP_LINE_LENGTH- See Also:
-
-
Constructor Details
-
L10NHelpers
public L10NHelpers()
-
-
Method Details
-
localize
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
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.
-