From 323372eff01ae170feba27111e060eebbb9bcc7a Mon Sep 17 00:00:00 2001
From: Dennis C
Date: Sat, 19 Oct 2024 01:32:15 +0200
Subject: [PATCH] [1.21.2] Replace RenderTooltipEvent.Color with
RenderTooltipEvent.Texture (#1599)
---
.../client/gui/GuiGraphics.java.patch | 5 +-
.../neoforge/client/ClientHooks.java | 7 +-
.../client/event/RenderTooltipEvent.java | 146 ++++--------------
.../oldtest/client/CustomTooltipTest.java | 10 +-
.../gui/sprites/tooltip/test_background.png | Bin 0 -> 9732 bytes
.../tooltip/test_background.png.mcmeta | 11 ++
.../gui/sprites/tooltip/test_frame.png | Bin 0 -> 4685 bytes
.../gui/sprites/tooltip/test_frame.png.mcmeta | 11 ++
8 files changed, 64 insertions(+), 126 deletions(-)
create mode 100644 tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png
create mode 100644 tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png.mcmeta
create mode 100644 tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_frame.png
create mode 100644 tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_frame.png.mcmeta
diff --git a/patches/net/minecraft/client/gui/GuiGraphics.java.patch b/patches/net/minecraft/client/gui/GuiGraphics.java.patch
index 60a00e141e..caca78e363 100644
--- a/patches/net/minecraft/client/gui/GuiGraphics.java.patch
+++ b/patches/net/minecraft/client/gui/GuiGraphics.java.patch
@@ -155,8 +155,9 @@
int i1 = vector2ic.y();
this.pose.pushPose();
int j1 = 400;
-+ net.neoforged.neoforge.client.event.RenderTooltipEvent.Color colorEvent = net.neoforged.neoforge.client.ClientHooks.onRenderTooltipColor(this.tooltipStack, this, l, i1, preEvent.getFont(), p_282615_);
- TooltipRenderUtil.renderTooltipBackground(this, l, i1, i, j, 400, p_371327_);
+- TooltipRenderUtil.renderTooltipBackground(this, l, i1, i, j, 400, p_371327_);
++ var textureEvent = net.neoforged.neoforge.client.ClientHooks.onRenderTooltipTexture(this.tooltipStack, this, l, i1, preEvent.getFont(), p_282615_, p_371327_);
++ TooltipRenderUtil.renderTooltipBackground(this, l, i1, i, j, 400, textureEvent.getTexture());
this.pose.translate(0.0F, 0.0F, 400.0F);
int k1 = i1;
diff --git a/src/main/java/net/neoforged/neoforge/client/ClientHooks.java b/src/main/java/net/neoforged/neoforge/client/ClientHooks.java
index a1b1166a57..0132b8a863 100644
--- a/src/main/java/net/neoforged/neoforge/client/ClientHooks.java
+++ b/src/main/java/net/neoforged/neoforge/client/ClientHooks.java
@@ -774,11 +774,8 @@ public static RenderTooltipEvent.Pre onRenderTooltipPre(ItemStack stack, GuiGrap
return preEvent;
}
- // TODO porting: potentially replace with a background texture event
- public static RenderTooltipEvent.Color onRenderTooltipColor(ItemStack stack, GuiGraphics graphics, int x, int y, Font font, List components) {
- var colorEvent = new RenderTooltipEvent.Color(stack, graphics, x, y, font, 0xf0100010, 0x505000FF, 0x5028007f, components);
- NeoForge.EVENT_BUS.post(colorEvent);
- return colorEvent;
+ public static RenderTooltipEvent.Texture onRenderTooltipTexture(ItemStack stack, GuiGraphics graphics, int x, int y, Font font, List components, @Nullable ResourceLocation texture) {
+ return NeoForge.EVENT_BUS.post(new RenderTooltipEvent.Texture(stack, graphics, x, y, font, components, texture));
}
public static List gatherTooltipComponents(ItemStack stack, List extends FormattedText> textElements, int mouseX, int screenWidth, int screenHeight, Font fallbackFont) {
diff --git a/src/main/java/net/neoforged/neoforge/client/event/RenderTooltipEvent.java b/src/main/java/net/neoforged/neoforge/client/event/RenderTooltipEvent.java
index e7f7c84657..1fff84cf30 100644
--- a/src/main/java/net/neoforged/neoforge/client/event/RenderTooltipEvent.java
+++ b/src/main/java/net/neoforged/neoforge/client/event/RenderTooltipEvent.java
@@ -12,7 +12,9 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner;
+import net.minecraft.core.component.DataComponents;
import net.minecraft.network.chat.FormattedText;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.tooltip.TooltipComponent;
import net.minecraft.world.item.ItemStack;
import net.neoforged.bus.api.Event;
@@ -21,6 +23,7 @@
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Nullable;
/**
* Fired during tooltip rendering.
@@ -28,7 +31,7 @@
*
* @see RenderTooltipEvent.GatherComponents
* @see RenderTooltipEvent.Pre
- * @see RenderTooltipEvent.Color
+ * @see RenderTooltipEvent.Texture
*/
public abstract class RenderTooltipEvent extends Event {
protected final ItemStack itemStack;
@@ -99,7 +102,7 @@ public Font getFont() {
*
* This event is {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
* If this event is cancelled, then the list of components will be empty, causing the tooltip to not be rendered and
- * the corresponding {@link RenderTooltipEvent.Pre} and {@link RenderTooltipEvent.Color} to not be fired.
+ * the corresponding {@link RenderTooltipEvent.Pre} and {@link RenderTooltipEvent.Texture} to not be fired.
*
* This event is fired on the {@linkplain NeoForge#EVENT_BUS main Forge event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.
@@ -179,7 +182,7 @@ public void setMaxWidth(int maxWidth) {
*
* This event is {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
* If this event is cancelled, then the tooltip will not be rendered and the corresponding
- * {@link RenderTooltipEvent.Color} will not be fired.
+ * {@link RenderTooltipEvent.Texture} will not be fired.
*
* This event is fired on the {@linkplain NeoForge#EVENT_BUS main Forge event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.
@@ -247,136 +250,51 @@ public void setY(int y) {
}
/**
- * 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.
+ * Fired when the textures for the tooltip background are determined.
+ * This can be used to modify the background and frame texture.
*
- * This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.
+ * This event is not {@linkplain ICancellableEvent cancellable}.
*
* This event is fired on the {@linkplain NeoForge#EVENT_BUS main Forge event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.
*/
- public static class Color extends RenderTooltipEvent {
- private final int originalBackground;
- private final int originalBorderStart;
- private final int originalBorderEnd;
- private int backgroundStart;
- private int backgroundEnd;
- private int borderStart;
- private int borderEnd;
+ public static class Texture extends RenderTooltipEvent {
+ @Nullable
+ private final ResourceLocation originalTexture;
+ @Nullable
+ private ResourceLocation texture;
@ApiStatus.Internal
- public Color(ItemStack stack, GuiGraphics graphics, int x, int y, Font fr, int background, int borderStart, int borderEnd, List components) {
- super(stack, graphics, x, y, fr, components);
- this.originalBackground = background;
- this.originalBorderStart = borderStart;
- this.originalBorderEnd = borderEnd;
- this.backgroundStart = background;
- this.backgroundEnd = background;
- this.borderStart = borderStart;
- this.borderEnd = borderEnd;
- }
-
- /**
- * {@return the gradient start color for the tooltip background (top edge)}
- */
- public int getBackgroundStart() {
- return backgroundStart;
- }
-
- /**
- * {@return the gradient end color for the tooltip background (bottom edge)}
- */
- public int getBackgroundEnd() {
- return backgroundEnd;
- }
-
- /**
- * Sets the new color for the tooltip background. This sets both the gradient start and end color for the
- * background to this color.
- *
- * @param background the new color for the tooltip background
- */
- public void setBackground(int background) {
- this.backgroundStart = background;
- this.backgroundEnd = background;
- }
-
- /**
- * Sets the new start color for the gradient of the tooltip background (top edge).
- *
- * @param backgroundStart the new start color for the tooltip background
- */
- public void setBackgroundStart(int backgroundStart) {
- this.backgroundStart = backgroundStart;
- }
-
- /**
- * Sets the new end color for the gradient of the tooltip background (bottom edge).
- *
- * @param backgroundEnd the new end color for the tooltip background
- */
- public void setBackgroundEnd(int backgroundEnd) {
- this.backgroundEnd = backgroundEnd;
- }
-
- /**
- * {@return the gradient start color for the tooltip border (top edge)}
- */
- public int getBorderStart() {
- return borderStart;
- }
-
- /**
- * Sets the new start color for the gradient of the tooltip border (top edge).
- *
- * @param borderStart the new start color for the tooltip border
- */
- public void setBorderStart(int borderStart) {
- this.borderStart = borderStart;
- }
-
- /**
- * {@return the gradient end color for the tooltip border (bottom edge)}
- */
- public int getBorderEnd() {
- return borderEnd;
- }
-
- /**
- * Sets the new end color for the gradient of the tooltip border (bottom edge).
- *
- * @param borderEnd the new end color for the tooltip border
- */
- public void setBorderEnd(int borderEnd) {
- this.borderEnd = borderEnd;
- }
-
- /**
- * {@return the original tooltip background's gradient start color (top edge)}
- */
- public int getOriginalBackgroundStart() {
- return originalBackground;
+ public Texture(ItemStack stack, GuiGraphics graphics, int x, int y, Font font, List components, @Nullable ResourceLocation texture) {
+ super(stack, graphics, x, y, font, components);
+ this.originalTexture = texture;
+ this.texture = texture;
}
/**
- * {@return the original tooltip background's gradient end color (bottom edge)}
+ * {@return the original texture location given to the tooltip render method (may originate from {@link DataComponents#TOOLTIP_STYLE})}
*/
- public int getOriginalBackgroundEnd() {
- return originalBackground;
+ @Nullable
+ public ResourceLocation getOriginalTexture() {
+ return originalTexture;
}
/**
- * {@return the original tooltip border's gradient start color (top edge)}
+ * {@return the texture location that will be used to render the tooltip}
*/
- public int getOriginalBorderStart() {
- return originalBorderStart;
+ @Nullable
+ public ResourceLocation getTexture() {
+ return texture;
}
/**
- * {@return the original tooltip border's gradient end color (bottom edge)}
+ * Set the texture to use for the tooltip background and frame or {@code null} to use the default textures.
+ *
+ * The given {@link ResourceLocation} will be prefixed with {@code tooltip/} and suffixed with {@code _background}
+ * and {@code _frame} to determine the background and frame texture respectively
*/
- public int getOriginalBorderEnd() {
- return originalBorderEnd;
+ public void setTexture(@Nullable ResourceLocation texture) {
+ this.texture = texture;
}
}
}
diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/CustomTooltipTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/CustomTooltipTest.java
index 1057944878..cb83eda472 100644
--- a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/CustomTooltipTest.java
+++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/CustomTooltipTest.java
@@ -18,6 +18,7 @@
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
@@ -115,6 +116,8 @@ public static void onRegisterClientTooltipComponentFactories(RegisterClientToolt
}
private static class ClientEventHandler {
+ private static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(ID, "test");
+
@SubscribeEvent
public static void gatherTooltips(RenderTooltipEvent.GatherComponents event) {
if (event.getItemStack().getItem() == Items.STICK) {
@@ -126,12 +129,9 @@ public static void gatherTooltips(RenderTooltipEvent.GatherComponents event) {
}
@SubscribeEvent
- public static void preTooltip(RenderTooltipEvent.Color event) {
+ public static void preTooltip(RenderTooltipEvent.Texture event) {
if (event.getItemStack().getItem() == Items.APPLE) {
- event.setBackgroundStart(0xFF0000FF);
- event.setBackgroundEnd(0xFFFFFF00);
- event.setBorderStart(0xFFFF0000);
- event.setBorderEnd(0xFF000011);
+ event.setTexture(TEXTURE);
}
}
}
diff --git a/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png b/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png
new file mode 100644
index 0000000000000000000000000000000000000000..1f5f803bf519e9d950ed5cddcabd435cdf90de5d
GIT binary patch
literal 9732
zcmeHLc{J4R+ec)VA|cDziD708hU|vy$-b5`3xl!DjEp5^%bFz;vNOmUDkP+2iwIGQ
zY-Qh~NaP*$tmplm^PcCN_xIm3b7t=E_r5>Z=f1AbeO=d?@5Gpyo?~U=Wul^@Vl~i*
zn^Q*A;fLWU<=bcamL+9)8fa-tG)MRYeDK~FtS1^k4Ddk%&?GE|ii$LbGjm{T2Qci-
zaR$)_SZ=^BFNp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anTT_5X=N9LARcBVv+5%?W*si&1Sg3oqtqE^&~Y
zJMFA6)Z4GtE@rWfJv_zj)+g}X!tAJkhl%X2VN5tnNo-dkW9p(MbjI3X1~6t|U+pW*
z?ldHA`_b;}=;K|k8y+!2Bgge^)H8y0#t>_HWLjqf>xRuZM+B_}GK9fZ!2V6@+;Udv
zvAx?h*SoBe*K13UCL{ap-^;%pi%=YmkZOZ_`El}%=Rdw9!uk>^KXLZeN*X2xRUN@z
z9Q*O}>~llq#A8PR6Wr}puU0bk=_XR5O3Q_x_RC!fV_u1W-<3%d4EC$?DphKqPofJ?
zV2n$8yB6qUIaH18KP@dPUt5Iv(YyJ$N|OCzO#dAj`1iU&2RvJBiMjOXpiG(H!;LhB
zp2;#CBKorYje6c;028MBHsm#RluqC0y!3Xo`C_Z_oVyTKG^qBoIP(RT8-`bBSXfKN
z%qBrsL_n|D&z6QHS%n8IM|R&i4ZmCod18IWSTxGVT2kLsJJ$Q&DBib;rTgQ7^;4^^
zh@tL8T$xMZx_xKMf;|f<;hQ*ba7V6J_W_MG%bId~7`}U1f9@xfG)8xWdziUHb_clbxZ$xiw
zrf4C>t`*I}ll=~8WSB1K}bZCMf
z-F6T1lpT3i{_D{TDYq^fdycUVMCjR9$FPo1HtI{*b0SX9hcD>(0bci0SC{z+(
z8(fsnQm}OTw1jZ6*uV!|9Jg?>(v@g?_rkie^!V+|GPw7u>gS?!o~O@WXt2seHr#|oYv3asma@^Xs{EeFhECpJNYL0g~uHH!i8#LTg
zB``fWe+{E*toYrKj=h{k`lP&A@`s8n;#b*fW8FZDtU>uXKT2Tv
literal 0
HcmV?d00001
diff --git a/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png.mcmeta b/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png.mcmeta
new file mode 100644
index 0000000000..c0435eb685
--- /dev/null
+++ b/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_background.png.mcmeta
@@ -0,0 +1,11 @@
+{
+ "gui": {
+ "scaling": {
+ "type": "nine_slice",
+ "width": 100,
+ "height": 100,
+ "border": 9,
+ "stretch_inner": true
+ }
+ }
+}
diff --git a/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_frame.png b/tests/src/main/resources/assets/custom_tooltip_test/textures/gui/sprites/tooltip/test_frame.png
new file mode 100644
index 0000000000000000000000000000000000000000..34c5e37f1a385e20ea3ef27d95a7f36658e89b2a
GIT binary patch
literal 4685
zcmeHKdr%YS7LOnrc?k7UEk(OTE23_)n+JJFRBnPKN&rcUc&paU?gn-s*^q2Vf<-|^
z@cM!aXsZ#f^#Lm4pwo+riq>KDO07(#deLevKCX{jMQuyfqW9Z?h`pV;2$_U+y6AYi%z#fX9g(Ln@PuIU%c!Hc^=*
z#JH^_M7k&whvT|rPMS0HB*g9d*NCahd?t-ORm*P+%Kmk0%g)-xtAcNoMEG<)UUCBG
zjPtGH9l8}ZV*VlHdG)fbx^?*xi9|MB>yY`i4x`35%=-EHwy}x60lEVW`q!#}%aaUC
zIX6#n;g(O*Z#2C7fs`i>KOB?synNElrv-ZpM;ZqYs;j}jyB}L$ACX%aGBwu!j5^b|
zMHbk)5;>HPe0={D`fV$c5!DIVbKW|Y+{8YFNC!!I{@GQFQk1UpSia8n;ySe9gmm0&h&*lWbsJ@<9JUe{ukTqce)iaj=`XANGm!4kdnl&kQpIf24g!
zT{P?3eEH72k_c548TaV?h)3>gU2Bd-1_WO9$(PjEUznEgUY^+T`NzItVLrqC&MfS7
zIq5X|MFsU!r>_UI)h`WJ&j3Z2O@ZP{)x|4t+RVoY+DP(UW-F*V4kvoL%ZlL{Bm)`A
zG|HmnJ!oj;K@_3n&6Vg7omEAqQ<@wbsn1C;;5iw%oZwBL<{#}+001+|V35n4X|XF@
zN}d;20p8hd0T1%3Fd0f-sxApq(KZqi^Tm7wj&)JlLf$lgDB4Dt6v^tDJrH1}2c_HE$jx+qk?48PCINk
z8JkU7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