Skip to content

Comments

[FIX] Fix for iceberg's tooltips#644

Open
kallmetony wants to merge 1 commit intoKiltMC:version/1.20.1from
kallmetony:fix/iceberg-duplicate-tooltips
Open

[FIX] Fix for iceberg's tooltips#644
kallmetony wants to merge 1 commit intoKiltMC:version/1.20.1from
kallmetony:fix/iceberg-duplicate-tooltips

Conversation

@kallmetony
Copy link
Contributor

No description provided.

@kallmetony
Copy link
Contributor Author

from #641

private List<ClientTooltipComponent> kilt$gatherForgeTooltips(List<ClientTooltipComponent> original, @Local(argsOnly = true) List<Component> lines, @Local(argsOnly = true) Optional<TooltipComponent> visualTooltipComponent, @Local(argsOnly = true, ordinal = 0) int mouseX, @Local(argsOnly = true) Font font) {
// Iceberg handles tooltip gathering and wrapping itself, so we should not interfere with it.
// Otherwise, we get duplicate tooltips when text wrapping is applied.
if (kilt$isIcebergLoaded) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels unsafe, are we sure this doesn't affect other Forge mods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I tested IAF and Minecolonies (with its deps) and everything works great

anyway, this only works in environments with Iceberg, and playing with Iceberg is pretty annoying, so users will end up uninstalling it along with any other mods that depend on it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look into other mods, specifically those that use the RenderTooltipEvent.GatherComponents event. Use the GitHub search to find mods that use this event themselves and make sure this code works as expected there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will do that on weekends. for now I can approve that it works in a modpack with 418 mods and 4 mods that do something with tooltips:

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kallmetony status?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants