mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Ensure sending players is done synchronously
This commit is contained in:
1 parent
d5427d76c7
commit
b2cf7dd686
1 file changed
+2
-2
@@ -18,12 +18,12 @@ public class PluginMessage {
|
|||||||
// Move a player to a different server in the bungee network
|
// Move a player to a different server in the bungee network
|
||||||
@SuppressWarnings("UnstableApiUsage")
|
@SuppressWarnings("UnstableApiUsage")
|
||||||
public static void sendPlayer(Player p, String targetServer) {
|
public static void sendPlayer(Player p, String targetServer) {
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
out.writeUTF("Connect");
|
out.writeUTF("Connect");
|
||||||
out.writeUTF(targetServer);
|
out.writeUTF(targetServer);
|
||||||
p.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
p.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
}, 1);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String MESSAGE_DATA_SEPARATOR = "$";
|
private static final String MESSAGE_DATA_SEPARATOR = "$";
|
||||||
|
|||||||
Reference in new issue
Block a user