Always early exit in join listeners

This commit is contained in:
Draycia committed 2021-12-03 19:50:07 -08:00
1 parent c32c0c30be
commit 65776cd34b
3 files changed
+15 -3

No files matched your search

@@ -55,6 +55,10 @@ public class SpongePlayerJoinListener {
@Listener
public void onPlayerLogin(final ServerSideConnectionEvent.Join event) {
if (!this.configFactory.primaryConfig().hideMutedJoinLeaveQuit()) {
return;
}
final ComponentPlayerResult<CarbonPlayer> result = this.carbonChat.server().player(event.player().uniqueId()).join();
final @Nullable CarbonPlayer player = result.player();
@@ -63,7 +67,7 @@ public class SpongePlayerJoinListener {
}
// Don't show join messages when muted
if (this.configFactory.primaryConfig().hideMutedJoinLeaveQuit() && player.muted()) {
if (player.muted()) {
event.setMessageCancelled(true);
}
}