Fix #1401 bungeecord message sent even if disabled

This commit is contained in:
ljacqu 2017-11-04 10:17:52 +01:00
parent 80f9ec88b8
commit 7d6c61258b

View File

@ -71,13 +71,11 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
* @param player The player to send. * @param player The player to send.
*/ */
public void connectPlayerOnLogin(Player player) { public void connectPlayerOnLogin(Player player) {
if (!isEnabled || destinationServerOnLogin.isEmpty()) { if (isEnabled && !destinationServerOnLogin.isEmpty()) {
return;
}
service.scheduleSyncDelayedTask(() -> service.scheduleSyncDelayedTask(() ->
sendBungeecordMessage("Connect", player.getName(), destinationServerOnLogin), 20L); sendBungeecordMessage("Connect", player.getName(), destinationServerOnLogin), 20L);
} }
}
/** /**
* Sends a message to the AuthMe plugin messaging channel, if enabled. * Sends a message to the AuthMe plugin messaging channel, if enabled.
@ -87,11 +85,9 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
*/ */
public void sendAuthMeBungeecordMessage(String type, String playerName) { public void sendAuthMeBungeecordMessage(String type, String playerName) {
if (isEnabled) { if (isEnabled) {
return;
}
sendBungeecordMessage("AuthMe", type, playerName.toLowerCase()); sendBungeecordMessage("AuthMe", type, playerName.toLowerCase());
} }
}
@Override @Override
public void onPluginMessageReceived(String channel, Player player, byte[] data) { public void onPluginMessageReceived(String channel, Player player, byte[] data) {