mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 20:57:35 +01:00
#1418 Cleanup
This commit is contained in:
parent
f23b8933ac
commit
3ca97f5d30
@ -1,5 +1,6 @@
|
|||||||
package fr.xephi.authme.service;
|
package fr.xephi.authme.service;
|
||||||
|
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.initialization.SettingsDependent;
|
import fr.xephi.authme.initialization.SettingsDependent;
|
||||||
@ -331,6 +332,18 @@ public class BukkitService implements SettingsDependent {
|
|||||||
useAsyncTasks = settings.getProperty(PluginSettings.USE_ASYNC_TASKS);
|
useAsyncTasks = settings.getProperty(PluginSettings.USE_ASYNC_TASKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send the specified message to bungeecord using the first available player connection.
|
||||||
|
*
|
||||||
|
* @param bytes the message
|
||||||
|
*/
|
||||||
|
public void sendBungeeMessage(byte[] bytes) {
|
||||||
|
Player player = Iterables.getFirst(getOnlinePlayers(), null);
|
||||||
|
if (player != null) {
|
||||||
|
player.sendPluginMessage(authMe, "BungeeCord", bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method run upon initialization to verify whether or not the Bukkit implementation
|
* Method run upon initialization to verify whether or not the Bukkit implementation
|
||||||
* returns the online players as a {@link Collection}.
|
* returns the online players as a {@link Collection}.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package fr.xephi.authme.service.bungeecord;
|
package fr.xephi.authme.service.bungeecord;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
@ -53,10 +52,7 @@ public class BungeeSender implements SettingsDependent {
|
|||||||
for (String element : data) {
|
for (String element : data) {
|
||||||
out.writeUTF(element);
|
out.writeUTF(element);
|
||||||
}
|
}
|
||||||
Player player = Iterables.getFirst(plugin.getServer().getOnlinePlayers(), null);
|
bukkitService.sendBungeeMessage(out.toByteArray());
|
||||||
if (player != null) {
|
|
||||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user