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 {
|
public class BungeeService implements SettingsDependent {
|
||||||
|
|
||||||
private AuthMe plugin;
|
private AuthMe plugin;
|
||||||
|
private BukkitService service;
|
||||||
|
|
||||||
private boolean isEnabled;
|
private boolean isEnabled;
|
||||||
private String bungeeServer;
|
private String bungeeServer;
|
||||||
@ -25,8 +26,9 @@ public class BungeeService implements SettingsDependent {
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
BungeeService(AuthMe plugin, Settings settings) {
|
BungeeService(AuthMe plugin, BukkitService service, Settings settings) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
this.service = service;
|
||||||
reload(settings);
|
reload(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,10 +43,15 @@ public class BungeeService implements SettingsDependent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
service.scheduleSyncDelayedTask(new Runnable() {
|
||||||
out.writeUTF("Connect");
|
@Override
|
||||||
out.writeUTF(bungeeServer);
|
public void run() {
|
||||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(bungeeServer);
|
||||||
|
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
|
}
|
||||||
|
}, 5L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user