Skip to content

Commit

Permalink
Fix default Minecraft join message not being used
Browse files Browse the repository at this point in the history
Default Minecraft join message not used when allow-silent-join-quit set to true
Remove unnecessary broadcast of join message since default join message is working again

Fixes EssentialsX#5796
  • Loading branch information
zp4rker committed Jun 27, 2024
1 parent 3a6fdd9 commit 47ed96e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ public void onPlayerJoin(final PlayerJoinEvent event) {
final String joinMessage = event.getJoinMessage();
ess.runTaskAsynchronously(() -> delayedJoin(event.getPlayer(), joinMessage));

if (hideJoinQuitMessages() || ess.getSettings().allowSilentJoinQuit() || ess.getSettings().isCustomJoinMessage()) {
final User user = ess.getUser(event.getPlayer());

if (hideJoinQuitMessages() || ess.getSettings().isCustomJoinMessage() || ess.getSettings().allowSilentJoinQuit() && (user.isAuthorized("essentials.silentjoin") || user.isAuthorized("essentials.silentjoin.vanish"))) {
event.setJoinMessage(null);
}
}
Expand Down Expand Up @@ -412,9 +414,6 @@ public void run() {
ess.getServer().broadcastMessage(msg);
}
effectiveMessage = msg.isEmpty() ? null : msg;
} else if (ess.getSettings().allowSilentJoinQuit()) {
ess.getServer().broadcastMessage(message);
effectiveMessage = message;
} else {
effectiveMessage = message;
}
Expand Down

0 comments on commit 47ed96e

Please sign in to comment.