mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-18 06:02:54 +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) {
|
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;
|
final MessageFormat format;
|
||||||
switch (type.getKey()) {
|
switch (type.getKey()) {
|
||||||
case "join":
|
case "join":
|
||||||
@ -130,7 +130,7 @@ public class BukkitListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
default: // So that it will always be initialised. Other options shouldn't be possible.
|
default: // So that it will always be initialised. Other options shouldn't be possible.
|
||||||
format = jda.getSettings().getQuitFormat(player);
|
format = jda.getSettings().getQuitFormat(player);
|
||||||
userCount = userCount - 1;
|
onlineCount = onlineCount - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -139,8 +139,8 @@ public class BukkitListener implements Listener {
|
|||||||
MessageUtil.sanitizeDiscordMarkdown(player.getName()),
|
MessageUtil.sanitizeDiscordMarkdown(player.getName()),
|
||||||
MessageUtil.sanitizeDiscordMarkdown(player.getDisplayName()),
|
MessageUtil.sanitizeDiscordMarkdown(player.getDisplayName()),
|
||||||
MessageUtil.sanitizeDiscordMarkdown(message),
|
MessageUtil.sanitizeDiscordMarkdown(message),
|
||||||
jda.getPlugin().getEss().getOnlinePlayers().size(),
|
onlineCount,
|
||||||
userCount),
|
jda.getPlugin().getEss().getUsers().getUserCount()),
|
||||||
player);
|
player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user