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
Modifier and TypeFieldDescriptionstatic FluidTooltipContext
The 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 FluidTooltipContext
fromMinecraft(net.minecraft.client.item.TooltipContext ctx)
int
boolean
boolean
boolean
boolean
boolean
boolean
boolean
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.
-
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#advancedItemTooltips
by 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
FluidTooltipContext
which usesMinecraftClient.options
.advancedItemTooltips
forisAdvanced()
.
-
forceAdvanced
- Returns:
- A
FluidTooltipContext
which uses the given value forisAdvanced()
.
-
usingConfigForSymbols
- Returns:
- A
FluidTooltipContext
which uses the LBA fluids config file forshouldUseSymbols()
.
-
forceSymbols
-
usingConfigForTicks
- Returns:
- A
FluidTooltipContext
which uses the LBA fluids config file forshouldUseTicks()
.
-
forceTicks
-
usingConfigForShortDesc
- Returns:
- A
FluidTooltipContext
which uses the LBA fluids config file forshouldUseTicks()
.
-
forceShortDesc
-
usingConfigForFluidColours
- Returns:
- A
FluidTooltipContext
which uses the LBA fluids config file forshouldStripFluidColours()
.
-
forceDisableFluidColours
-
usingConfigForEmphasisColours
- Returns:
- A
FluidTooltipContext
which uses the LBA fluids config file forshouldDisableEmphasisColours()
.
-
forceDisableEmphasisColours
-
usingConfigForJoinedName
- Returns:
- A
FluidTooltipContext
which 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.
-