Class LoreReader
java.lang.Object
studio.magemonkey.fabled.enchants.util.LoreReader
FabledEnchants © 2026 VoidEdge
util.studio.magemonkey.fabled.enchants.LoreReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatEnchantment(CustomEnchantment enchantment, int level) Formats an enchantment name for appending to an item's lore.static booleanisEnchantment(String line) Checks whether or not the lore line is the line for the given enchantmentstatic intparseEnchantmentLevel(String text) Parses a level from a lore line.static StringparseEnchantmentName(String text) Parses an enchantment name from a bit of text, assuming the format is "{color}{enchantment} {level}"
-
Constructor Details
-
LoreReader
public LoreReader()
-
-
Method Details
-
parseEnchantmentName
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
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
Formats an enchantment name for appending to an item's lore.- Parameters:
enchantment- enchantment namelevel- level of the enchantment- Returns:
- lore string for the enchantment
-
isEnchantment
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
-