Merge branch 'dev/1.1.0' into decode-multiple

This commit is contained in:
Andrew Steinborn
2020-05-29 19:03:03 -04:00
3 changed files with 44 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.tree.LiteralCommandNode;
import com.velocitypowered.api.event.command.PlayerAvailableCommandsEvent;
import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.proxy.VelocityServer;
@@ -175,7 +176,11 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
.build();
commands.getRootNode().addChild(root);
}
return false;
server.getEventManager().fire(
new PlayerAvailableCommandsEvent(serverConn.getPlayer(), commands.getRootNode()))
.thenAcceptAsync(event -> playerConnection.write(commands), playerConnection.eventLoop());
return true;
}
@Override