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

I added option to disable command suggestions in chat :,) #1347

Closed
wants to merge 8 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import com.mojang.brigadier.suggestion.Suggestions;
import meteordevelopment.meteorclient.systems.commands.Commands;
import meteordevelopment.meteorclient.systems.config.Config;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.CommandSuggestor;
import net.minecraft.client.gui.widget.TextFieldWidget;
Expand All @@ -22,6 +24,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.client.util.math.MatrixStack;

import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -71,4 +74,9 @@ public void onRefresh(CallbackInfo ci, String string, StringReader reader) {
}
}

@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
public void render(MatrixStack matrices, int mouseX, int mouseY, CallbackInfo info) {
arlomcwalter marked this conversation as resolved.
Show resolved Hide resolved
if (Modules.get().get(NoRender.class).noCommandSuggestions()) info.cancel();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ public class NoRender extends Module {
.build()
);

private final Setting<Boolean> noCommandSuggestions = sgOverlay.add(new BoolSetting.Builder()
.name("command-suggestions")
.description("Disables command suggestions in chat.")
.defaultValue(false)
.build()
);

// HUD

private final Setting<Boolean> noBossBar = sgHUD.add(new BoolSetting.Builder()
Expand Down Expand Up @@ -336,6 +343,10 @@ public boolean noEatParticles() {
return isActive() && noEatParticles.get();
}

public boolean noCommandSuggestions() {
return isActive() && noCommandSuggestions.get();
}

// HUD

public boolean noBossBar() {
Expand Down