Revert to old createProfile(UUID, String) logic #7723
Merged
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.
The recent change to the createProfile method set, which allowed plugins
to properly create profiles with differing names/uuids for players
currently on the server broke an implicit method contract for plugins
providing the lowercased version of a player name to the method.
Previously, the returned profile would simply be pulled from an online
player with the same name (when compared case-insensitively), however
the previously mentioned fix to the creation logic currently returns
a profile with the lowercased name instead.
To not break plugins that relied on this specific internal logic, the
ability to create pre-filled profiles with different names or uuids for
players that are currently online is moved by this commit to a new
method called createProfileExact, which simply mirrors the current
createProfile logic.
The createProfile logic is hence returned to its old functionality, once
again allowing plugins to grab an online players profile from their
lowercased name.
See: #7558
Resolves: #7700
Potential points of discussions:
This PR actively brings back (in my opinion) unwanted behaviour to the
createProfile
method. While I see the use of the logic in said method, I am uncertain whether moving the (in my opinion) correct logic to a new method likecreateProfileExact
is the way to go here or if we should move the old logic into a new method. Both sides have their benefits, however the patch currently introduces a new method as not break plugins that relied on the lowercase hack.