diff options
author | xef5000 <64156533+xef5000@users.noreply.github.com> | 2023-04-09 12:24:31 -0400 |
---|---|---|
committer | xef5000 <64156533+xef5000@users.noreply.github.com> | 2023-04-09 12:24:31 -0400 |
commit | f03aae672d740f9b6cc5a0713b997b8e842078b4 (patch) | |
tree | 42dea841a7bab663d0784f7f326cf0af79d92dd0 | |
parent | 100ec81fc2f2af8f19cf034e2130ca7ba2661d4e (diff) | |
download | NotEnoughUpdates-f03aae672d740f9b6cc5a0713b997b8e842078b4.tar.gz NotEnoughUpdates-f03aae672d740f9b6cc5a0713b997b8e842078b4.tar.bz2 NotEnoughUpdates-f03aae672d740f9b6cc5a0713b997b8e842078b4.zip |
Change @Redirect to @ModifyArg
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 12 |
1 files 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; } } |