Skip to content

Commit

Permalink
Ensure sending players is done synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Jul 7, 2021
1 parent d5427d7 commit b2cf7dd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public class PluginMessage {
// Move a player to a different server in the bungee network
@SuppressWarnings("UnstableApiUsage")
public static void sendPlayer(Player p, String targetServer) {
Bukkit.getScheduler().runTaskLater(plugin, () -> {
Bukkit.getScheduler().runTask(plugin, () -> {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(targetServer);
p.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
}, 1);
});
}

private static final String MESSAGE_DATA_SEPARATOR = "$";
Expand Down

0 comments on commit b2cf7dd

Please sign in to comment.