如何更改播放器Bungeecord的服务器

时间:2017-06-24 04:30:58

标签: java minecraft bukkit bungeecord

我想知道如何移动播放器的目标服务器到目前为止我没有任何代码,我找不到任何东西,但我正在为我的Minecraft服务器网络私人使用插件。我已经有一个名为Command Sync的插件,它将我的BungeeCord服务器和我的Spigot服务器与let S be the solution vector, as wide as A, containing row numbers. let Z be a vector containing the number of zeros in each column. for each row: select the cells which contain 1 in A and no value in S. select from those cells those with the highest score in Z. select from those cells the first (or a random) cell. store the row number in the column of S corresponding to the cell. 联系在一起,其中sync console bungee send @p tntwars是我的目标服务器。 这就是我所知道的,因为Spigot论坛非常糟糕且无用>

如何将该播放器移至另一台服务器?

谢谢Will

1 个答案:

答案 0 :(得分:2)

来自Bungee插件:

请参阅https://www.spigotmc.org/wiki/sending-players-between-servers-in-bungeecord/

ServerInfo target = ProxyServer.getInstance().getServerInfo("Hub");
player.connect(target);

来自Spigot插件:

请参阅https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#connect

将示例连接到服务器。

 ByteArrayDataOutput out = ByteStreams.newDataOutput();
 out.writeUTF("Connect");
 out.writeUTF("pvp");    
 //applies to the player you send it to. aka Kick To Server.
 Player player = Bukkit.getPlayerExact("Example");
 player.sendPluginMessage(this, "BungeeCord", out.toByteArray());

ConnectOther示例到服务器。

 ByteArrayDataOutput out = ByteStreams.newDataOutput();
 out.writeUTF("ConnectOther");
 out.writeUTF("Example");
 out.writeUTF("pvp");
 //Any online player at all.
 //Aka Pull To Server.
 Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
 player.sendPluginMessage(this, "BungeeCord", out.toByteArray());

如果没有任何在线玩家,您无法向Bungee发送消息!