Updated totem tooltip to display N/A for cost when the target is also N/A.

This commit is contained in:
2026-01-18 00:52:36 +01:00
parent 8b296c6750
commit 6bb74b3635

View File

@ -203,11 +203,13 @@ public abstract class TotemItem extends Item {
).withStyle(ChatFormatting.GRAY));
tooltipComponents.add(LangAsset.TOOLTIP_TOTEM_TARGET_COST.getComponent(
Component.literal(String.format("%d", getTargetCost(totemData))).withStyle(
getTargetCost(totemData) <= getMaxCharge()
? ChatFormatting.WHITE
: ChatFormatting.RED
)
totemData.getTargetUUID().isPresent()
? Component.literal(String.format("%d", getTargetCost(totemData))).withStyle(
getTargetCost(totemData) <= getMaxCharge()
? ChatFormatting.WHITE
: ChatFormatting.RED
)
: LangAsset.GENERAL_NA.getComponent().withStyle(ChatFormatting.RED)
).withStyle(ChatFormatting.GRAY));
tooltipComponents.add(LangAsset.TOOLTIP_TOTEM_CHARGES.getComponent(