-
-
Notifications
You must be signed in to change notification settings - Fork 133
Feature not working "quick lookup" [Fabric 1.20.1] #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Working on fix. Current solution: replace MixinGuiGraphics with MixinAbstractContainerScreen. MixinAbstractContainerScreen turns itemStack into list of text Components used to display tooltip... My current solution. package vazkii.patchouli.mixin.client;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.world.inventory.Slot;
import vazkii.patchouli.client.handler.TooltipHandler;
@Mixin(AbstractContainerScreen.class)
public class MixinAbstractContainerScreen{
@Shadow
Slot hoveredSlot;
@Inject(at = @At("HEAD"), method = "renderTooltip(Lnet/minecraft/client/gui/GuiGraphics;II)V")
public void patchouli_onRenderTooltip(GuiGraphics guiGraphics, int x, int y, CallbackInfo info) {
if (((AbstractContainerScreen) (Object) this).getMenu().getCarried().isEmpty() && hoveredSlot != null && hoveredSlot.hasItem()) {
ItemStack itemStack = this.hoveredSlot.getItem();
TooltipHandler.onTooltip(guiGraphics, itemStack, x, y);
}
}
} Requires a few more tests, because all items are rendered over half-transparent half-black background of patchouli "quick lookup" tooltip. But, thanks god, it usable already... |
Patched version with fixed "quick lookup" and new render method of "lookup" UI: |
MixinGuiGraphics used to provide "quick lookup" feature was bind to `public void renderTooltip(Font font, ItemStack itemStack, int i, int j)` method of `GuiGraphics.class` that was not working for unknown reason. Current mixin bind to `protected void renderTooltip(GuiGraphics guiGraphics, int i, int j)` method in `AbstractContainerScreen.class`. Rellated issue: VazkiiMods#788
Mod loader
Fabric
Minecraft version
1.20.1
Patchouli version
1.20.1-84.1-fabric (downloaded from modrinth)
Modloader version
fabric-api-0.92.3+1.20.1.jar
Modpack info
Loaded mods:
The latest.log file
log.txt
Issue description
It seems that "quick lookup" feature is not working on Fabric 1.20.1...
No UI appears, holding
Ctrl
(orShift
) key with mouse over item withlinked_recipe
dosen't open a book.But blocks in the world can be "lookedup" by pressing "Shift+RMB" on them...
Steps to reproduce
botania:lexicon
itemhotbar
,offhand
,first left inventory slot
Botania
mod withlinked_recipe
propety inLexicon
set totrue
Other information
System: ArchLinux 6.13.5-arch1-1
Desctop: Wayland (Also tested with X11)
Desctop Environment: labwc+xfce4
Java: java-17-openjdk (Feature is working on forge 1.16.5 with same java version)
All packages is up to date and working smoothly...
The text was updated successfully, but these errors were encountered: