Skip to content

Commit

Permalink
✨ New working lobby command.
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmaes committed Jun 20, 2023
1 parent 2db547d commit 20244b2
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ public LobbyCommand(final @NotNull Main main) {

@Override
public void execute(CommandSender commandSender, String[] strings) {
if (!(commandSender instanceof ProxiedPlayer)) return;
final ProxiedPlayer player = (ProxiedPlayer) commandSender;
if (!(commandSender instanceof final ProxiedPlayer player)) return;
if (player.getServer().getInfo().getName().equals("lobby")) return;

final ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("lobby");

player.sendData("BungeeCord", out.toByteArray());
player.connect(this.main.getProxy().getServerInfo("lobby"));
}
}

0 comments on commit 20244b2

Please sign in to comment.