Advanced NBT Tooltips

Advanced NBT Tooltips

28.9k Downloads

Bug: Issue with other mod "NBT Tooltip"

TheMuffinPony opened this issue ยท 1 comments

commented

Introduction

I would like to use this mod with another similar mod, "NBT Tooltip" by zabi94 (source | CurseForge page)
NBT Tooltip simply provides the raw NBT data of an item at the bottom of its tooltip, similar to how Advanced NBT Tooltip does.
See issue zabi94/NBTTooltip#8 for this same issue on its issue tracker.

The bug

When both mods (NBT Tooltip and Advanced NBT Tooltip) are loaded, NBT Tooltip will not function whatsoever (including copying an item's NBT; it will still inject its keybind into the options menu) and neither mod appears to log to console (searching for 'NBT' will only show Fabric loading both mods with no apparent errors). Advanced NBT Tooltip, however, will work seemingly just fine.

I believe that this is an issue with how both mods inject data into the tooltip; Advanced NBT Tooltip seems to get priority and completely overwrites the entire tooltip.

Reproduction

  1. Download the latest version of NBT Tooltip (version 1.0.6 as of writing) via CurseForge and the latest version of Advanced NBT Tooltip (version 1.3.0 as of writing) via Github or CurseForge.
  2. Install ONLY NBT Tooltip, launch Minecraft, and enter a world, preferably one where you can spawn custom items.
  3. Observe that, when an item with any amount of NBT is hovered over, the NBT data is shown below the tooltip. Also, observe that using down arrow should copy the item's data to your clipboard and show a toast in the top right corner of your screen confirming this.
  4. Quit Minecraft, uninstall/disable NBT Tooltip, install/enable Advanced NBT Tooltip, relaunch Minecraft, and re-enter the world.
  5. Observe that Advanced NBT Tooltip works as well by hovering over an item with NBT that Advanced NBT Tooltips can parse (a simple example is an item repaired in an anvil that has a repair cost).
  6. Quit Minecraft, enable both NBT Tooltip and Advanced NBT Tooltip, relaunch Minecraft, and re-enter the world.

Expected Behavior

When hovering over an item, it will show both Advanced NBT Tooltip info and NBT Tooltip info, and NBT Tooltip will copy correctly.

Actual Behavior

Only Advanced NBT Tooltip shows its tooltip; NBT Tooltip will not show its tooltip and will not do anything when the "copy" key is pressed.

commented

This happened probably due to my ItemStackMixin forcing the getTooltip method to return before doing other mixin code. It might have sufficed to just remove that one line of code but to be sure I integrated my code with the same fabric api as the mod so there shouldn't be an issue like this in the future