Skip to content

Conversation

@luisc99
Copy link
Contributor

@luisc99 luisc99 commented Jan 15, 2021

Information

This fixes a quirk in which if the display name is changed by another plugin (eg: prefixes from PEX), it is possible for two online users to change their nicknames to be the same. As far as I can tell, no such previous issue exists.

Details

Proposed fix:

Check for nickname similarity switched to split on nickname prefix, rather than replace it. This avoids capturing anything in the display name before the nickname prefix, which correctly shows a warning if a duplicate exists.

Environments tested:

  • Latest Paper Version (any OS, any Java 8+ version)

Adjusts the check to see if a nickname is in use to split on the nickname prefix, rather than replace. This ensures the check is performed correctly when other plugins adds prefixes or things to the display name (eg: PEX)
@JRoy
Copy link
Member

JRoy commented Jan 15, 2021

Better solution would be to directly get the nickname through User methods and compare that way

@luisc99
Copy link
Contributor Author

luisc99 commented Jan 15, 2021

True. The main reason I did it this way was to keep the changes to a minimum, but that would also work

JRoy
JRoy previously approved these changes Jan 28, 2021
@JRoy JRoy enabled auto-merge (squash) January 28, 2021 15:08
@JRoy JRoy changed the title Adjust duplicate nickname check Fix duplicate nickname check with custom display names Jan 28, 2021
@JRoy JRoy merged commit f1ef21e into EssentialsX:2.x Jan 28, 2021
@mdcfe mdcfe added this to the 2.19.0 milestone Feb 20, 2021
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
)

Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants