Skip to content

Commit

Permalink
fix: new players are not reflected in player counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Jan 14, 2023
1 parent 4109c6e commit 4b8bd1b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public ServerListener(@NotNull DiscordChatBridgePlugin plugin) {
}

protected void processJoin(@NotNull UUID uuid, @NotNull String name, @NotNull String displayName) {
joinedPlayers.add(uuid);
plugin.getBot().updateGame();

// The reason for not checking the config setting here is that if it is disabled, the user will not be added to the FirstJoinPlayerHolder.
if (FirstJoinPlayerHolder.remove(uuid)) {
var format = plugin.getFormatConfig().get(FormatSettings.SERVER_FIRST_JOIN);
Expand All @@ -52,9 +55,6 @@ protected void processJoin(@NotNull UUID uuid, @NotNull String name, @NotNull St
}
}

joinedPlayers.add(uuid);
plugin.getBot().updateGame();

if (plugin.getGeneralConfig().get(GeneralSettings.SEND_JOIN_MESSAGE)) {
var format = plugin.getFormatConfig().get(FormatSettings.SERVER_JOIN);

Expand Down

0 comments on commit 4b8bd1b

Please sign in to comment.