forked from xsun2001/Applied-Energistics-2-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 194
fix crafting order chat notification showing item name in wrong locale #1361
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
Closed
Eldrinn-Elantey
wants to merge
3
commits into
master
from
fix/crafting-notification-item-name-localization
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
3cadf06
fix crafting order chat notification showing item name in wrong locale
Eldrinn-Elantey 8b5bab0
Spotless apply for branch fix/crafting-notification-item-name-localiz…
github-actions[bot] f86afe5
Merge branch 'master' into fix/crafting-notification-item-name-locali…
Dream-Master File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can’t we use ChatComponentItemName from GTNHLib?
https://github.com/GTNewHorizons/GTNHLib/blob/master/src/main/java/com/gtnewhorizon/gtnhlib/chat/customcomponents/ChatComponentItemName.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returns just
stack.getDisplayName()with no brackets or hover event. There's also no mixin in GTNHLib that adds that rendering in GuiChat. Replacing with it would drop the[...]brackets and the item tooltip hover, which are part of vanillafunc_151000_E()behavior that this fix preserves.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, couldn’t these two lines be replaced?
Also, for the hover event, it might be worth adding an option to ChatComponentItemName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points. We ended up moving the fix to Hodgepodge (GTNewHorizons/Hodgepodge#924) so it applies globally to all mods, not just AE2U.
On ChatComponentTranslation: it works for simple items but breaks for anything with a custom display name (renamed items, enchanted items, items with NBT-driven names) since getUnlocalizedName() won't reflect those. ChatComponentItemName with full ItemStack serialization handles all cases correctly.
On the hover event in ChatComponentItemName: agreed it would be cleaner to have it there rather than in a separate GuiChat mixin. Filed GTNewHorizons/GTNHLib#396 for the brackets change already. The hover tooltip is currently handled by a dedicated mixin in Hodgepodge to avoid the NBT toString crash from GTNH#21933/#21940 - if GTNHLib adds a safe binary-serialized hover event we can drop that mixin.