fancynpcs: Fix legacy formatting in team names - #313
Open
flennium wants to merge 1 commit into
Open
Conversation
Author
|
I used a small local repro plugin to verify this. It creates a FancyNpcs API NPC, then reflects the runtime NPC fields:
I can provide the repro plugin source if needed. |
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.
Description
Fixes #290.
FancyNpcs generated hidden fake player names with legacy formatting codes and reused that same value as the scoreboard team identifier. This PR keeps the hidden local player name unchanged, but gives each NPC a separate plain ASCII team name before creating
PlayerTeampackets.Checklist
Fixes #290orCloses #290mainbranchChanges
teamNamefield toNpc, generated once per NPC instance."npc-" + localNamewith the plainteamNamein all active FancyNpcs v2 NMS implementations.localNameunchanged for fake player/GameProfile names, so NPC name hiding behavior stays the same.Evidence
Buggy FancyNpcs 2.11.0 on Paper 1.21.11 with Nexo 1.25.1:
Fixed jar with the same server/plugins:
How to Test
/fnlegacyrepro npcthen/fnlegacyrepro inspect; the repro confirms the team name is derived from the legacy-codedlocalName./fnlegacyrepro cleanup,/fnlegacyrepro npc, then/fnlegacyrepro inspect.FIX VERIFIED: FancyNpcs teamName is plain and separate from localName.Local checks run:
rg -n -F '"npc-" + localName' plugins\fancynpcs-v2returned no matches.git diff --checkpassed../gradlew.bat --no-daemon --console=plain :plugins:fancynpcs-v2:fn-v2-api:buildpassed.Known local environment blocker:
./gradlew.bat --no-daemon --console=plain :plugins:fancynpcs-v2:shadowJarand./gradlew.bat --no-daemon --console=plain testfail before this code compiles because Paper's 1.21.11 dev bundle resolvesnet.kyori:adventure-text-serializer-ansiwithout a version for:libraries:packets:implementations:1_21_11:compileJava.