-
-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add config option for new username join messages #4290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom-new-username-message
should rely on custom-join-message
being set as well. Otherwise we end up with weird behavior when we don't have a custom join message and we find out in delayedJoin that the user doesn't have a name change.
So don't modify the initial string at all, I guess? If they want to change it have them set the join message to "{USERNAME}{OLDUSERNAME} joined the game"? |
No no, keep the separate messages, but only do |
Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java
Outdated
Show resolved
Hide resolved
This fixes a bug in #4290 in which custom join messages would throw a NullPointerException if the user hasn't changed their username.
Information
This PR closes #2716.
Details
Proposed feature:
As proposed in the aforementioned issue, this PR implements support for prior username checking.
This only shows when the stored last username differs from what the user joined with. I.e., it will only show when they join for the first time after a name change assuming they have joined before.
This feature isn't enabled by default and must be configured to work properly.
Environments tested:
Tested via
./gradlew EssentialsX:runServer
OS: Mac OS X 10.16 (x86_64) aka macOS Big Sur
Java version: Java 15 (OpenJDK 64-Bit Server VM 15.0.1+9-18)
Demonstration:
(Assuming new username each time)
Modified
custom-join-message
:Final thoughts
We never appear to have modified the join message ever, so doing it feels a bit weird. Worst case we only change it for custom join messages. Does this feel like the best way to handle it?