diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 15 |
1 files changed, 7 insertions, 8 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 04f3ba93..f9e0a132 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -67,7 +67,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import java.util.Set; -@Mixin(GuiContainer.class) +@Mixin(value = GuiContainer.class, priority = 500) public abstract class MixinGuiContainer extends GuiScreen { private static boolean hasProfileViewerStack = false; private static final ItemStack profileViewerStack = Utils.createItemStack( @@ -172,14 +172,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; } } @@ -302,7 +300,8 @@ public abstract class MixinGuiContainer extends GuiScreen { public boolean drawScreen_canBeHovered(Slot slot) { if ((NotEnoughUpdates.INSTANCE.config.improvedSBMenu.hideEmptyPanes && BetterContainers.isOverriding() && BetterContainers.isBlankStack(slot.slotNumber, slot.getStack())) || - slot.getStack() != null && slot.getStack().hasTagCompound() && slot.getStack().getTagCompound().getBoolean("NEUHIDETOOLIP")) { + slot.getStack() != null && + slot.getStack().hasTagCompound() && slot.getStack().getTagCompound().getBoolean("NEUHIDETOOLIP")) { return false; } return slot.canBeHovered(); |