mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 09:08:01 +01:00
Fix inaccurate online player count for Discord leave message (#5440)
fixes #5256
This commit is contained in:
parent
f26e1b2e29
commit
52c9ca8197
@ -119,7 +119,7 @@ public class BukkitListener implements Listener {
|
||||
}
|
||||
|
||||
public void sendJoinQuitMessage(final Player player, final String message, MessageType type) {
|
||||
int userCount = jda.getPlugin().getEss().getUsers().getUserCount();
|
||||
int onlineCount = jda.getPlugin().getEss().getOnlinePlayers().size();
|
||||
final MessageFormat format;
|
||||
switch (type.getKey()) {
|
||||
case "join":
|
||||
@ -130,7 +130,7 @@ public class BukkitListener implements Listener {
|
||||
break;
|
||||
default: // So that it will always be initialised. Other options shouldn't be possible.
|
||||
format = jda.getSettings().getQuitFormat(player);
|
||||
userCount = userCount - 1;
|
||||
onlineCount = onlineCount - 1;
|
||||
break;
|
||||
|
||||
}
|
||||
@ -139,8 +139,8 @@ public class BukkitListener implements Listener {
|
||||
MessageUtil.sanitizeDiscordMarkdown(player.getName()),
|
||||
MessageUtil.sanitizeDiscordMarkdown(player.getDisplayName()),
|
||||
MessageUtil.sanitizeDiscordMarkdown(message),
|
||||
jda.getPlugin().getEss().getOnlinePlayers().size(),
|
||||
userCount),
|
||||
onlineCount,
|
||||
jda.getPlugin().getEss().getUsers().getUserCount()),
|
||||
player);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user