CraftTweaker

CraftTweaker

151M Downloads

Tooltip clearing does not work properly

IchHabeHunger54 opened this issue ยท 3 comments

commented

What happens:

Tooltip clearing does not work properly. See the following screenshot:
image

What you expected to happen:

For it to work properly...? This is what it looks like without that line:
image
The lines:

  • Item Name
  • Tooltip (which is the thing to be removed)
  • Advanced Tooltips
  • JEI Integration's Max Stack Size Information
  • Mod Id (JEI)

Script used:

Relevant code:
<item:cyclic:laser>.clearTooltip();

crafttweaker.log file:

Log acts like everything is fine, there are no errors; this is the only line even containing "tooltip":
[17:17:35.310][DONE][CLIENT][INFO] Clearing the tooltip for: <item:cyclic:laser>


Environment:

  • Minecraft Version: 1.16.5
  • Forge Version: 36.1.0
  • CraftTweaker Version: 7.1.0.252
  • Are you using a server: no
commented

Tooltip clearing works fine.

The tooltip is all the text in the blue box, so the actual lines are just:

  • Tooltip (which is the thing to be removed)

The tooltip is given to us in a List<ITextComponent> and we quite literally just call .clear();

If you want to remove specific lines of the tooltip, use removeTooltip(String regex).

As for the modid, that isn't part of the tooltip, if you look at the item in your inv vs in JEI, you will see that JEI shows the modid while your inventory doesn't (shouldn't anyway).

This is how JEI does it, and why we can't clear it:

https://github.com/mezz/JustEnoughItems/blob/HEAD/src/main/java/mezz/jei/render/IngredientRenderHelper.java#L25-L26

commented

Ok, my bad then.

commented

It's all good, when I was first messing with it I was also under the impression that the name / modid wasn't the tooltip.

As for the JEI stuff, I actually thought that was a bug until I looked into it, it is kinda weird how it is a hardcoded tooltip