Skip to content

Fix compatibility with Feather Client #5436

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

IHaxU
Copy link

@IHaxU IHaxU commented May 30, 2025

Type of change

  • Bug fix
  • New feature

Description

This modifies ChatHudMixin to ensure compatibility between Meteor Client and Feather client. Using @Local in mixins targeting the addVisibleMessage method causes crashes when used alongside Feather. This change removes the use of @Local, instead manually reconstructing the necessary variables to maintain the same functionality.

Related issues

Mention any issues that this pr relates to.

How Has This Been Tested?

2025-05-30.03-01-15.mp4

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@machiecodes
Copy link
Contributor

I'm opening 3 PRs this week to break feather client more

@RacoonDog
Copy link
Collaborator

instead of duplicating all the logic vanilla does, you could also just target something else that includes the index, like the List#get call in the loop

@IHaxU
Copy link
Author

IHaxU commented May 30, 2025

instead of duplicating all the logic vanilla does, you could also just target something else that includes the index, like the List#get call in the loop

Could you elaborate on this? I duplicated vanilla logic cause onBreakChatMessageLines used a @Local (@Local List<OrderedText> list)

@RacoonDog
Copy link
Collaborator

instead of duplicating all the logic vanilla does, you could also just target something else that includes the index, like the List#get call in the loop

Could you elaborate on this? I duplicated vanilla logic cause onBreakChatMessageLines used a @Local (@Local List<OrderedText> list)

target @At(value = "INVOKE", target = "Ljava/util/List;add(ILjava/lang/Object;)V", remap = false) and capture the argument, this would get the same value as what the @Local that was breaking compat had

@IHaxU
Copy link
Author

IHaxU commented May 30, 2025

instead of duplicating all the logic vanilla does, you could also just target something else that includes the index, like the List#get call in the loop

Could you elaborate on this? I duplicated vanilla logic cause onBreakChatMessageLines used a @Local (@Local List<OrderedText> list)

target @At(value = "INVOKE", target = "Ljava/util/List;add(ILjava/lang/Object;)V", remap = false) and capture the argument, this would get the same value as what the @Local that was breaking compat had

I believe list.get is in the for-loop, while our mixin method is before the for-loop,

instead of duplicating all the logic vanilla does, you could also just target something else that includes the index, like the List#get call in the loop

Could you elaborate on this? I duplicated vanilla logic cause onBreakChatMessageLines used a @Local (@Local List<OrderedText> list)

target @At(value = "INVOKE", target = "Ljava/util/List;add(ILjava/lang/Object;)V", remap = false) and capture the argument, this would get the same value as what the @Local that was breaking compat had

Did I achieve what you wanted correctly in this commit?

@IHaxU
Copy link
Author

IHaxU commented May 30, 2025

Seems it broke compatibility with the worlds most fragile client (Feather)

@IHaxU
Copy link
Author

IHaxU commented May 30, 2025

There we go


// Get list for later usage at anti-spam

@Redirect(method = "addVisibleMessage", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/ChatMessages;breakRenderedChatMessageLines(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/client/font/TextRenderer;)Ljava/util/List;"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Redirect is very bad for mod compatibility, capture the return value with a @ModifyExpressionValue instead

IHaxU and others added 4 commits June 1, 2025 08:08
Co-authored-by: RacoonDog <32882447+RacoonDog@users.noreply.github.com>
Co-authored-by: RacoonDog <32882447+RacoonDog@users.noreply.github.com>
Co-authored-by: RacoonDog <32882447+RacoonDog@users.noreply.github.com>
Co-authored-by: RacoonDog <32882447+RacoonDog@users.noreply.github.com>
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