Revert Velocity console MiniPlaceholders special case - #847
Open
jpenilla wants to merge 1 commit into
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
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.
This reverts the Velocity portion of #758. It does not revert the unrelated Paper run-task change included in that PR.
For a player message rendered to console, the sender is the player who sent the message and the recipient is console. With relational MiniPlaceholders enabled, Carbon passes:
MiniPlaceholders v3 treats the first audience as the principal audience. Normal audience placeholders therefore resolve for console. Player-only placeholders such as
<player_current_server>cannot resolve, and LuckPerms cannot find a user for the console identity.#758 replaces the console recipient with
sourced.sender().sourced.sender()is the player, not console, so it instead passes:This is why the change appeared to work: normal audience placeholders once again receive a player. However, it only works by discarding the actual recipient. Relational placeholders are also evaluated as the player's relationship with themselves.
How we got here
Before MiniPlaceholders v3, Carbon could provide normal audience placeholders for the sender separately from relational placeholders for the recipient and sender.
The intended roles were established through several earlier fixes:
(recipient, sender).#690 then updated Carbon for MiniPlaceholders v3. In v3, placeholder resolvers receive their audience from the MiniMessage parsing context. Relational placeholders require a
RelationalAudience, whose first audience is also the principal used by normal audience placeholders.This means Carbon can no longer simultaneously provide:
in one parse without additional parsing or format complexity. Passing
(recipient, sender)for relational placeholders necessarily makes normal audience placeholders use the recipient too.91f00da3 introduced the
relational-placeholdersconfig option and disabled it by default for this reason. 5ee2f950 then made the parsing audience follow that option.This intentionally provides two modes:
relational-placeholdersfalsetrue(recipient, sender). Normal audience placeholders consequently resolve for the recipient, and formats may need to select the sender explicitly.#732 was filed against beta.36, before these two modes existed, so relational parsing was unavoidable in the latest release and the original report was reasonable. By the time #758 was merged, the config solution above was already on trunk; affected users should instead have been directed to the appropriate mode or format adjustment described below. #758 bypassed that solution by introducing a third, Velocity-console-only behavior.
Resolution for users affected by #732
For formats like the one reported in #732, leave
relational-placeholdersdisabled. If relational placeholders are actually needed, keep the option enabled and explicitly select the sender where necessary. For example, using the Expressions Provider:or:
Carbon's
render_fortag is another option where appropriate, with the existing caveats around preprocess tags and nested MiniMessage parsing.This revert removes the third, console-specific behavior and restores the same configured semantics for every Velocity recipient.