Class FluidTooltipContext
java.lang.Object
alexiil.mc.lib.attributes.fluid.volume.FluidTooltipContext
Stores various options for creating tooltips for fluids. This is meant to wrap a
TooltipContext, but has a
lot more options specific to fluids and isn't limited to the client side only.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FluidTooltipContextThe default context, that lets the user decide how they want to see tooltips. -
Method Summary
Modifier and TypeMethodDescriptionforceAdvanced(boolean enable) forceDisableEmphasisColours(boolean disable) forceDisableFluidColours(boolean disable) forceJoinedName(boolean enable) forceShortDesc(boolean enable) forceSymbols(boolean enable) forceTicks(boolean enable) static FluidTooltipContextfromMinecraft(net.minecraft.client.item.TooltipContext ctx) intbooleanbooleanbooleanbooleanbooleanbooleanbooleannet.minecraft.text.TextstripFluidColours(net.minecraft.text.Text fluidName) Strips any colours from the given name ifshouldStripFluidColours()is true, otherwise returns the fluid name as-is.
-
Field Details
-
USE_CONFIG
The default context, that lets the user decide how they want to see tooltips.
-
-
Method Details
-
fromMinecraft
-
isAdvanced
public boolean isAdvanced()- Returns:
- True to add advanced details, or false otherwise. Note that this returns
GameOptions.advancedItemTooltipsby default.
-
shouldUseSymbols
public boolean shouldUseSymbols() -
shouldUseTicks
public boolean shouldUseTicks() -
getTimeGap
public int getTimeGap()- Returns:
- The number of ticks between each unit of time. (so 1 for ticks, and 20 for seconds).
-
shouldUseShortDescription
public boolean shouldUseShortDescription() -
shouldStripFluidColours
public boolean shouldStripFluidColours() -
shouldDisableEmphasisColours
public boolean shouldDisableEmphasisColours() -
shouldJoinNameWithAmount
public boolean shouldJoinNameWithAmount() -
usingMcAdvanced
- Returns:
- A
FluidTooltipContextwhich usesMinecraftClient.options.advancedItemTooltipsforisAdvanced().
-
forceAdvanced
- Returns:
- A
FluidTooltipContextwhich uses the given value forisAdvanced().
-
usingConfigForSymbols
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldUseSymbols().
-
forceSymbols
-
usingConfigForTicks
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldUseTicks().
-
forceTicks
-
usingConfigForShortDesc
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldUseTicks().
-
forceShortDesc
-
usingConfigForFluidColours
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldStripFluidColours().
-
forceDisableFluidColours
-
usingConfigForEmphasisColours
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldDisableEmphasisColours().
-
forceDisableEmphasisColours
-
usingConfigForJoinedName
- Returns:
- A
FluidTooltipContextwhich uses the LBA fluids config file forshouldJoinNameWithAmount().
-
forceJoinedName
-
stripFluidColours
public net.minecraft.text.Text stripFluidColours(net.minecraft.text.Text fluidName) Strips any colours from the given name ifshouldStripFluidColours()is true, otherwise returns the fluid name as-is.
-