Class RenderTooltipEvent.Color
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RenderTooltipEvent
net.neoforged.neoforge.client.event.RenderTooltipEvent.Color
- Enclosing class:
RenderTooltipEvent
Fired when the colours for the tooltip background are determined.
This can be used to modify the background color and the border's gradient colors.
This event is not cancellable, and does not
.invalid reference
have a result
This event is fired on the main Forge event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.RenderTooltipEvent
RenderTooltipEvent.Color, RenderTooltipEvent.GatherComponents, RenderTooltipEvent.Pre -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate intprivate intprivate final intprivate final intprivate final intFields inherited from class net.neoforged.neoforge.client.event.RenderTooltipEvent
components, font, graphics, itemStack, x, y -
Constructor Summary
ConstructorsConstructorDescriptionColor(ItemStack stack, GuiGraphics graphics, int x, int y, Font fr, int background, int borderStart, int borderEnd, List<ClientTooltipComponent> components) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the gradient end color for the tooltip background (bottom edge).intReturns the gradient start color for the tooltip background (top edge).intReturns the gradient end color for the tooltip border (bottom edge).intReturns the gradient start color for the tooltip border (top edge).intReturns the original tooltip background's gradient end color (bottom edge).intReturns the original tooltip background's gradient start color (top edge).intReturns the original tooltip border's gradient end color (bottom edge).intReturns the original tooltip border's gradient start color (top edge).voidsetBackground(int background) Sets the new color for the tooltip background.voidsetBackgroundEnd(int backgroundEnd) Sets the new end color for the gradient of the tooltip background (bottom edge).voidsetBackgroundStart(int backgroundStart) Sets the new start color for the gradient of the tooltip background (top edge).voidsetBorderEnd(int borderEnd) Sets the new end color for the gradient of the tooltip border (bottom edge).voidsetBorderStart(int borderStart) Sets the new start color for the gradient of the tooltip border (top edge).Methods inherited from class net.neoforged.neoforge.client.event.RenderTooltipEvent
getComponents, getFont, getGraphics, getItemStack, getX, getY
-
Field Details
-
originalBackground
private final int originalBackground -
originalBorderStart
private final int originalBorderStart -
originalBorderEnd
private final int originalBorderEnd -
backgroundStart
private int backgroundStart -
backgroundEnd
private int backgroundEnd -
borderStart
private int borderStart -
borderEnd
private int borderEnd
-
-
Constructor Details
-
Color
@Internal public Color(ItemStack stack, GuiGraphics graphics, int x, int y, Font fr, int background, int borderStart, int borderEnd, List<ClientTooltipComponent> components)
-
-
Method Details
-
getBackgroundStart
public int getBackgroundStart()Returns the gradient start color for the tooltip background (top edge).- Returns:
- the gradient start color for the tooltip background (top edge)
-
getBackgroundEnd
public int getBackgroundEnd()Returns the gradient end color for the tooltip background (bottom edge).- Returns:
- the gradient end color for the tooltip background (bottom edge)
-
setBackground
public void setBackground(int background) Sets the new color for the tooltip background. This sets both the gradient start and end color for the background to this color.- Parameters:
background- the new color for the tooltip background
-
setBackgroundStart
public void setBackgroundStart(int backgroundStart) Sets the new start color for the gradient of the tooltip background (top edge).- Parameters:
backgroundStart- the new start color for the tooltip background
-
setBackgroundEnd
public void setBackgroundEnd(int backgroundEnd) Sets the new end color for the gradient of the tooltip background (bottom edge).- Parameters:
backgroundEnd- the new end color for the tooltip background
-
getBorderStart
public int getBorderStart()Returns the gradient start color for the tooltip border (top edge).- Returns:
- the gradient start color for the tooltip border (top edge)
-
setBorderStart
public void setBorderStart(int borderStart) Sets the new start color for the gradient of the tooltip border (top edge).- Parameters:
borderStart- the new start color for the tooltip border
-
getBorderEnd
public int getBorderEnd()Returns the gradient end color for the tooltip border (bottom edge).- Returns:
- the gradient end color for the tooltip border (bottom edge)
-
setBorderEnd
public void setBorderEnd(int borderEnd) Sets the new end color for the gradient of the tooltip border (bottom edge).- Parameters:
borderEnd- the new end color for the tooltip border
-
getOriginalBackgroundStart
public int getOriginalBackgroundStart()Returns the original tooltip background's gradient start color (top edge).- Returns:
- the original tooltip background's gradient start color (top edge)
-
getOriginalBackgroundEnd
public int getOriginalBackgroundEnd()Returns the original tooltip background's gradient end color (bottom edge).- Returns:
- the original tooltip background's gradient end color (bottom edge)
-
getOriginalBorderStart
public int getOriginalBorderStart()Returns the original tooltip border's gradient start color (top edge).- Returns:
- the original tooltip border's gradient start color (top edge)
-
getOriginalBorderEnd
public int getOriginalBorderEnd()Returns the original tooltip border's gradient end color (bottom edge).- Returns:
- the original tooltip border's gradient end color (bottom edge)
-