Class Lang

java.lang.Object
dev.crafty.core.util.Lang

public class Lang extends Object
  • Constructor Details

    • Lang

      public Lang()
  • Method Details

    • colorize

      public static String colorize(String str)
    • colorizeList

      public static List<String> colorizeList(List<String> str)
    • colorizeWithPlaceholders

      public static net.kyori.adventure.text.Component colorizeWithPlaceholders(org.bukkit.entity.Player viewer, net.kyori.adventure.text.Component component)
      Apply PlaceholderAPI replacements on the plain text of the given component, then parse the result as MiniMessage, and apply optional style fixes.
      Parameters:
      viewer - The player for PlaceholderAPI context
      component - The input component to process
      Returns:
      A styled Component with placeholders and MiniMessage parsed
    • quotePlaceholderValues

      public static String quotePlaceholderValues(String expr, org.bukkit.entity.Player viewer)
      Used in expressions
    • colorizeListWithPlaceholders

      public static List<net.kyori.adventure.text.Component> colorizeListWithPlaceholders(org.bukkit.entity.Player viewer, List<net.kyori.adventure.text.Component> components)
      Helper to do the same on a list of Components (like lore lines).
    • replaceText

      public static void replaceText(org.bukkit.inventory.ItemStack item, Map<String,String> mappings)
    • replacePlaceholders

      public static String replacePlaceholders(String message, org.bukkit.entity.Player player)
      Replaces placeholders in the given message using the PlaceholderAPI context.
      Parameters:
      message - The input string containing placeholders to be replaced.
      player - The player context for placeholder replacement. If null, global placeholders are used.
      Returns:
      The message with placeholders replaced. If no PlaceholderBridge is available, the original message is returned.