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

fix calc command #415

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ public class MixinClientCommandHandler_CommandFix {

@Inject(method = "executeCommand", at = @At("HEAD"), cancellable = true)
private void hodgepodge$checkSlash(ICommandSender sender, String message, CallbackInfoReturnable<Integer> cir) {
if (!message.trim().startsWith("/")) {
final String trim = message.trim();
if (trim.startsWith("=")) {
// there is a command that provides a calculator in the chat,
// and in that case, it's more convenient to not have to write the `/`
return;
}
if (!trim.startsWith("/")) {
cir.setReturnValue(0);
}
}
Expand Down