Package foundry.veil.render.ui
Interface Tooltippable
- All Known Implementing Classes:
BlockEntityMixin
public interface Tooltippable
Interface for components that can have a tooltip displayed when hovered over in-world
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddTooltip(String tooltip) Add a tooltip component to the block entityvoidaddTooltip(List<net.minecraft.network.chat.Component> tooltip) Add a list of tooltip components to the block entityvoidaddTooltip(net.minecraft.network.chat.Component tooltip) Add a tooltip component to the block entitygetItems()Get the items to render in the tooltip and data about themnet.minecraft.world.item.ItemStackgetStack()The stack for the tooltip to take components fromgetTheme()Get the theme object for the tooltip from the block entityObtain the timeline for the tooltipList<net.minecraft.network.chat.Component>Get the tooltip components from the block entityintIncrease the tooltip heightintIncrease the tooltip widthintGet the x offset for the tooltipintGet the y offset for the tooltipbooleanWhether the tooltip should be rendered in worldspace or notbooleanvoidloadTooltipData(net.minecraft.nbt.CompoundTag tag) net.minecraft.nbt.CompoundTagvoidsetBackgroundColor(int color) Set the background color of the themevoidsetBottomBorderColor(int color) Set the bottom border color of the themevoidsetTheme(ColorTheme theme) Set the theme object for the tooltip from the block entityvoidsetTooltip(List<net.minecraft.network.chat.Component> tooltip) Set the tooltip components for the block entityvoidsetTopBorderColor(int color) Set the top border color of the theme
-
Method Details
-
getTooltip
List<net.minecraft.network.chat.Component> getTooltip()Get the tooltip components from the block entity- Returns:
- the tooltip components
-
isTooltipEnabled
boolean isTooltipEnabled() -
saveTooltipData
net.minecraft.nbt.CompoundTag saveTooltipData() -
loadTooltipData
void loadTooltipData(net.minecraft.nbt.CompoundTag tag) -
setTooltip
Set the tooltip components for the block entity- Parameters:
tooltip- the tooltip components to set
-
addTooltip
void addTooltip(net.minecraft.network.chat.Component tooltip) Add a tooltip component to the block entity- Parameters:
tooltip-
-
addTooltip
Add a list of tooltip components to the block entity- Parameters:
tooltip-
-
addTooltip
Add a tooltip component to the block entity- Parameters:
tooltip-
-
getTheme
ColorTheme getTheme()Get the theme object for the tooltip from the block entity- Returns:
- the theme object
- See Also:
-
setTheme
Set the theme object for the tooltip from the block entity- Parameters:
theme- the theme object to set
-
setBackgroundColor
void setBackgroundColor(int color) Set the background color of the theme- Parameters:
color- the color to set
-
setTopBorderColor
void setTopBorderColor(int color) Set the top border color of the theme- Parameters:
color-
-
setBottomBorderColor
void setBottomBorderColor(int color) Set the bottom border color of the theme- Parameters:
color-
-
getWorldspace
boolean getWorldspace()Whether the tooltip should be rendered in worldspace or not- Returns:
- true if the tooltip should be rendered in worldspace, false if it should be rendered in screenspace
-
getTimeline
TooltipTimeline getTimeline()Obtain the timeline for the tooltip- Returns:
- the timeline
-
getStack
net.minecraft.world.item.ItemStack getStack()The stack for the tooltip to take components from- Returns:
- the stack
-
getTooltipWidth
int getTooltipWidth()Increase the tooltip width- Returns:
- the bonus width
-
getTooltipHeight
int getTooltipHeight()Increase the tooltip height- Returns:
- the bonus height
-
getTooltipXOffset
int getTooltipXOffset()Get the x offset for the tooltip- Returns:
-
getTooltipYOffset
int getTooltipYOffset()Get the y offset for the tooltip- Returns:
-
getItems
List<VeilUIItemTooltipDataHolder> getItems()Get the items to render in the tooltip and data about them- Returns:
- the items
-