Skip to content

Commit 8982aae

Browse files
authored
Fix updating join message when not needed (#6312)
Prevents calling setJoinMessage when the message is unchanged causing Bukkit to no longer send the translation key to the client (nuking vanilla translation) Fixes #6307
1 parent 22b4975 commit 8982aae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,10 @@ private void joinFlow(final User user, final long currentTime, final String mess
450450
effectiveMessage = message;
451451
}
452452

453-
joinMessageConsumer.accept(effectiveMessage);
453+
// Only change the vanilla join message if it's different to avoid nuking client translation
454+
if (effectiveMessage != null && !effectiveMessage.equals(message) || message != null && effectiveMessage == null) {
455+
joinMessageConsumer.accept(effectiveMessage);
456+
}
454457

455458
ess.runTaskAsynchronously(() -> ess.getServer().getPluginManager().callEvent(new AsyncUserDataLoadEvent(user, effectiveMessage)));
456459

0 commit comments

Comments
 (0)