Package net.minecraftforge.client.event
Class RenderTooltipEvent.Color
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
net.minecraftforge.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 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.minecraftforge.client.event.RenderTooltipEvent
RenderTooltipEvent.Color, RenderTooltipEvent.GatherComponents, RenderTooltipEvent.Pre
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private int
private int
private final int
private final int
private final int
Fields inherited from class net.minecraftforge.client.event.RenderTooltipEvent
components, font, itemStack, poseStack, x, y
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the gradient end color for the tooltip background.int
Returns the gradient start color for the tooltip background.int
Returns the gradient end color for the tooltip border.int
Returns the gradient start color for the tooltip border.int
Returns the original tooltip background's gradient end color.int
Returns the original tooltip background's gradient start color.int
Returns the original tooltip border's gradient end color.int
Returns the original tooltip border's gradient start color.void
setBackground
(int background) Sets the new color for the tooltip background.void
setBackgroundEnd
(int backgroundEnd) Sets the new end color for the gradient of the tooltip background.void
setBackgroundStart
(int backgroundStart) Sets the new start color for the gradient of the tooltip background.void
setBorderEnd
(int borderEnd) Sets the new end color for the gradient of the tooltip border.void
setBorderStart
(int borderStart) Sets the new start color for the gradient of the tooltip border.Methods inherited from class net.minecraftforge.client.event.RenderTooltipEvent
getComponents, getFont, getItemStack, getPoseStack, getX, getY
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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(@NotNull @NotNull ItemStack stack, PoseStack poseStack, int x, int y, @NotNull @NotNull Font fr, int background, int borderStart, int borderEnd, @NotNull @NotNull List<ClientTooltipComponent> components)
-
-
Method Details
-
getBackgroundStart
public int getBackgroundStart()Returns the gradient start color for the tooltip background.- Returns:
- the gradient start color for the tooltip background
-
getBackgroundEnd
public int getBackgroundEnd()Returns the gradient end color for the tooltip background.- Returns:
- the gradient end color for the tooltip background
-
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.- 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.- Parameters:
backgroundEnd
- the new end color for the tooltip background
-
getBorderStart
public int getBorderStart()Returns the gradient start color for the tooltip border.- Returns:
- the gradient start color for the tooltip border
-
setBorderStart
public void setBorderStart(int borderStart) Sets the new start color for the gradient of the tooltip border.- Parameters:
borderStart
- the new start color for the tooltip border
-
getBorderEnd
public int getBorderEnd()Returns the gradient end color for the tooltip border.- Returns:
- the gradient end color for the tooltip border
-
setBorderEnd
public void setBorderEnd(int borderEnd) Sets the new end color for the gradient of the tooltip border.- Parameters:
borderEnd
- the new end color for the tooltip border
-
getOriginalBackgroundStart
public int getOriginalBackgroundStart()Returns the original tooltip background's gradient start color.- Returns:
- the original tooltip background's gradient start color
-
getOriginalBackgroundEnd
public int getOriginalBackgroundEnd()Returns the original tooltip background's gradient end color.- Returns:
- the original tooltip background's gradient end color
-
getOriginalBorderStart
public int getOriginalBorderStart()Returns the original tooltip border's gradient start color.- Returns:
- the original tooltip border's gradient start color
-
getOriginalBorderEnd
public int getOriginalBorderEnd()Returns the original tooltip border's gradient end color.- Returns:
- the original tooltip border's gradient end color
-