-
-
Notifications
You must be signed in to change notification settings - Fork 109
Use Adventure for formatted text #2778
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
tal5
wants to merge
28
commits into
DenizenScript:dev
Choose a base branch
from
tal5:adventure_chat_switch
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
… into adventure_chat_switch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Moves over formatted text parsing and features to Paper, using Adventure instead of Bungee chat.
Not going to go over every change for obvious reasons, but overall:
FormattedTextHelper
& its related classes have been moved to the paper module, and converted to adventure (with minimal fixes for API differences between Bungee chat and adventure).PaperModule
methods/changed to use/store JSON strings instead ofBaseComponent
s, which can then be managed using the newparseTextToJson
/parseJsonToText
compatibility methods.player receives message
, enchantment script's display name cache, etc.Some Significant Additions
TextFormattingTags
in the paper module, implementing all the base text tag bases (e.g.&hover
).LegacyColor
&LegacyFormatting
inFormatteedTextHelper
for some places that need that (although ideally we'll be able to move away from that in the future).PaperModule#parseTextToJson
/parseJsonToText
- compatibility methods, to use a generic format in some places and avoid Spigot/Paper specific impls of things (mostly in NMS stuff).ItemHelper#createItemWithNMSComponents
- for converting an item hover to an item on 1.20/21, untilPaperMC/Paper#13067
.Handler(NMS)#stringifyNMSComponent
/parseNMSComponent
- replacing the oldBaseComponent
conversion methods, and operating on dFormattedText instead.Note
In the URL handling logic at the end of
parseInternal
, is it meant to be copying the entire component (e.g. including click events and whatnot) as opposed to just the styling?Note
Not sure if the handling in the Spigot impl of
parseTextToJson
is correct? Maybe it should utilizeTextComponent#fromLegacyText
?