mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 02:35:11 +01:00
Schedule connectPlayer action
Thanks to @Dimatert9
This commit is contained in:
parent
20ab161406
commit
9381d024cd
@ -17,6 +17,7 @@ import javax.inject.Inject;
|
||||
public class BungeeService implements SettingsDependent {
|
||||
|
||||
private AuthMe plugin;
|
||||
private BukkitService service;
|
||||
|
||||
private boolean isEnabled;
|
||||
private String bungeeServer;
|
||||
@ -25,8 +26,9 @@ public class BungeeService implements SettingsDependent {
|
||||
* Constructor.
|
||||
*/
|
||||
@Inject
|
||||
BungeeService(AuthMe plugin, Settings settings) {
|
||||
BungeeService(AuthMe plugin, BukkitService service, Settings settings) {
|
||||
this.plugin = plugin;
|
||||
this.service = service;
|
||||
reload(settings);
|
||||
}
|
||||
|
||||
@ -41,10 +43,15 @@ public class BungeeService implements SettingsDependent {
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF("Connect");
|
||||
out.writeUTF(bungeeServer);
|
||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||
service.scheduleSyncDelayedTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF("Connect");
|
||||
out.writeUTF(bungeeServer);
|
||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||
}
|
||||
}, 5L);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user