Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client commands appear in command block suggestions #3540

Open
haykam821 opened this issue Jan 20, 2024 · 0 comments
Open

Client commands appear in command block suggestions #3540

haykam821 opened this issue Jan 20, 2024 · 0 comments
Labels
bug Something isn't working priority:medium Medium priority PRs that should get reviews

Comments

@haykam821
Copy link
Contributor

A command registered to the client command dispatcher is still shown within the suggestions for a command block, most likely because of a mixin that affects all uses of the server command dispatcher even in situations where client commands are not applicable:

@SuppressWarnings({"unchecked", "rawtypes"})
@Inject(method = "onCommandTree", at = @At("RETURN"))
private void onOnCommandTree(CommandTreeS2CPacket packet, CallbackInfo info) {
// Add the commands to the vanilla dispatcher for completion.
// It's done here because both the server and the client commands have
// to be in the same dispatcher and completion results.
ClientCommandInternals.addCommands((CommandDispatcher) commandDispatcher, (FabricClientCommandSource) commandSource);
}

@modmuss50 modmuss50 added bug Something isn't working priority:medium Medium priority PRs that should get reviews labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:medium Medium priority PRs that should get reviews
Projects
None yet
Development

No branches or pull requests

2 participants