From f03aae672d740f9b6cc5a0713b997b8e842078b4 Mon Sep 17 00:00:00 2001 From: xef5000 <64156533+xef5000@users.noreply.github.com> Date: Sun, 9 Apr 2023 12:24:31 -0400 Subject: Change @Redirect to @ModifyArg --- .../moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index adae04f8..38de4fd4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -66,7 +66,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import java.util.Set; -@Mixin(GuiContainer.class) +@Mixin(GuiContainer.class, priority=500) public abstract class MixinGuiContainer extends GuiScreen { private static boolean hasProfileViewerStack = false; private static final ItemStack profileViewerStack = Utils.createItemStack( @@ -171,14 +171,12 @@ public abstract class MixinGuiContainer extends GuiScreen { } } - @Redirect(method = "drawScreen", at = @At( - value = "INVOKE", - target = "Lnet/minecraft/client/gui/inventory/GuiContainer;renderToolTip(Lnet/minecraft/item/ItemStack;II)V")) - public void drawScreen_renderTooltip(GuiContainer guiContainer, ItemStack stack, int x, int y) { + @ModifyArg(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/inventory/GuiContainer;renderToolTip(Lnet/minecraft/item/ItemStack;II)V"), index = 0) + public ItemStack adjustItemStack(ItemStack itemStack) { if (theSlot.slotNumber == BetterContainers.profileViewerStackIndex) { - this.renderToolTip(profileViewerStack, x, y); + return profileViewerStack; } else { - this.renderToolTip(stack, x, y); + return itemStack; } } -- cgit