Class DebugTooltipFormatter
java.lang.Object
johnsmith.enchantmentcore.client.tooltip.DebugTooltipFormatter
- All Implemented Interfaces:
EnchantmentTooltipFormatter
A diagnostic formatter used to test the capabilities of the TooltipFormatterRegistry.
Demonstrates prepending, appending, and mutating the vanilla target text,
alongside utilizing the provided ItemStack context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat(net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int level, net.minecraft.world.item.ItemStack itemStack) Formats the tooltip lines for a single enchantment entry on the givenItemStack.intReturns the execution priority of this formatter.booleanDetermines whether this formatter is currently active and eligible to format tooltips.
-
Constructor Details
-
DebugTooltipFormatter
public DebugTooltipFormatter()
-
-
Method Details
-
format
public Optional<List<net.minecraft.network.chat.Component>> format(net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int level, net.minecraft.world.item.ItemStack itemStack) Description copied from interface:EnchantmentTooltipFormatterFormats the tooltip lines for a single enchantment entry on the givenItemStack.- Specified by:
formatin interfaceEnchantmentTooltipFormatter- Parameters:
enchantment- The registryHolderof the enchantment being rendered.level- The active level of the enchantment on the item.itemStack- TheItemStackhosting the enchantment.- Returns:
- An
Optionalcontaining the list of formattedComponentlines to append to the tooltip, orOptional.empty()to pass evaluation to the next lower-priority formatter.
-
getPriority
public int getPriority()Description copied from interface:EnchantmentTooltipFormatterReturns the execution priority of this formatter. Formatters with higher priority values are queried first byTooltipFormatterRegistry.- Specified by:
getPriorityin interfaceEnchantmentTooltipFormatter- Returns:
- The integer priority value.
-
isEnabled
public boolean isEnabled()Description copied from interface:EnchantmentTooltipFormatterDetermines whether this formatter is currently active and eligible to format tooltips.- Specified by:
isEnabledin interfaceEnchantmentTooltipFormatter- Returns:
trueif enabled,falseto skip this formatter.
-