Fix bungee desti randomisation

This commit is contained in:
Sekwah 2023-04-25 15:42:55 +01:00
parent 10fb927dbe
commit 2f808ed9ab
No known key found for this signature in database
GPG Key ID: 9E0D654FC942286D
1 changed files with 2 additions and 1 deletions

View File

@ -531,10 +531,11 @@ public class Portal {
if (portal.getDestinations().length != 0) {
if(plugin.isProxyPluginEnabled()) {
String randomDest = portal.getDestinations()[random.nextInt(portal.getDestinations().length)];
ByteArrayDataOutput outForList = ByteStreams.newDataOutput();
outForList.writeUTF(BungeeMessages.ENTER_PORTAL);
outForList.writeUTF(bungeeServer);
outForList.writeUTF(String.join(",", portal.getDestinations()));
outForList.writeUTF(randomDest);
outForList.writeUTF(player.getUniqueId().toString());
player.sendPluginMessage(plugin, BungeeMessages.CHANNEL_NAME, outForList.toByteArray());