Class LoreReader

java.lang.Object
studio.magemonkey.fabled.enchants.util.LoreReader

public class LoreReader extends Object
FabledEnchants © 2026 VoidEdge util.studio.magemonkey.fabled.enchants.LoreReader
  • Constructor Details

    • LoreReader

      public LoreReader()
  • Method Details

    • parseEnchantmentName

      public static String parseEnchantmentName(String text)
      Parses an enchantment name from a bit of text, assuming the format is "{color}{enchantment} {level}"
      Parameters:
      text - text to parse from
      Returns:
      enchantment name
    • parseEnchantmentLevel

      public static int parseEnchantmentLevel(String text)
      Parses a level from a lore line. This expects valid roman numerals to be at the end of the line with no spaces after it, matching the format for enchantments.
      Parameters:
      text - text to parse the level from
      Returns:
      parsed level or 1 if not found
    • formatEnchantment

      public static String formatEnchantment(CustomEnchantment enchantment, int level)
      Formats an enchantment name for appending to an item's lore.
      Parameters:
      enchantment - enchantment name
      level - level of the enchantment
      Returns:
      lore string for the enchantment
    • isEnchantment

      public static boolean isEnchantment(String line)
      Checks whether or not the lore line is the line for the given enchantment
      Parameters:
      line - line to check
      Returns:
      true if the line matches, false otherwise