Don't register /viaversion command as VFP alias to prevent mismatches with server-side ViaVersion

This commit is contained in:
FlorianMichael 2023-12-31 16:51:24 +01:00
parent 5c07c00b3b
commit 26c5bee954
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -242,10 +242,8 @@ public class ProtocolHack {
// Register command callback for /viaversion and /viafabricplus
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
final var commandHandler = (ViaFabricPlusVLCommandHandler) Via.getManager().getCommandHandler();
final var executor = RequiredArgumentBuilder.<FabricClientCommandSource, String>argument("args", StringArgumentType.greedyString()).
executes(commandHandler::execute).suggests(commandHandler::suggestion);
final var executor = RequiredArgumentBuilder.<FabricClientCommandSource, String>argument("args", StringArgumentType.greedyString()).executes(commandHandler::execute).suggests(commandHandler::suggestion);
dispatcher.register(LiteralArgumentBuilder.<FabricClientCommandSource>literal("viaversion").then(executor).executes(commandHandler::execute));
dispatcher.register(LiteralArgumentBuilder.<FabricClientCommandSource>literal("viafabricplus").then(executor).executes(commandHandler::execute));
});