mirror of
https://github.com/Shimeo98/DiscordWhitelisterSpigot.git
synced 2025-01-10 10:28:26 +01:00
Fixed an error when attempting to assign player count regardless of if the bot was initialized successfully
This commit is contained in:
parent
6b83b1d2f6
commit
e23e4b3f66
@ -1,5 +1,5 @@
|
||||
name: DiscordWhitelister
|
||||
version: 1.3.1
|
||||
version: 1.3.2
|
||||
author: Joe Shimell
|
||||
main: uk.co.angrybee.joe.DiscordWhitelister
|
||||
description: Discord whitelister bot.
|
||||
|
@ -112,21 +112,22 @@ public class DiscordWhitelister extends JavaPlugin
|
||||
if(initializeSuccess == 0)
|
||||
{
|
||||
getLogger().info("Successfully initialized Discord client.");
|
||||
|
||||
// Only attempt to set player count if the bot successfully initialized
|
||||
if(getWhitelisterBotConfig().getBoolean("show-player-count"))
|
||||
{
|
||||
// Register events if enabled
|
||||
getServer().getPluginManager().registerEvents(new JoinLeaveEvents(), this);
|
||||
|
||||
// Set initial player count
|
||||
DiscordClient.SetPlayerCountStatus(getOnlineUsers());
|
||||
}
|
||||
}
|
||||
else if(initializeSuccess == 1)
|
||||
{
|
||||
getLogger().severe("Discord Client failed to initialize, please check if your config file is valid.");
|
||||
}
|
||||
}
|
||||
|
||||
if(getWhitelisterBotConfig().getBoolean("show-player-count"))
|
||||
{
|
||||
// Register events if enabled
|
||||
getServer().getPluginManager().registerEvents(new JoinLeaveEvents(), this);
|
||||
|
||||
// Set initial player count
|
||||
DiscordClient.SetPlayerCountStatus(getOnlineUsers());
|
||||
}
|
||||
}
|
||||
|
||||
public static JavaPlugin getPlugin()
|
||||
|
@ -9,5 +9,5 @@ public class VersionInfo {
|
||||
return "v." + getVersion();
|
||||
}
|
||||
|
||||
private static String version = "1.3.1";
|
||||
private static String version = "1.3.2";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user