Skip to content

Commit

Permalink
fix calc command (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdoru authored Aug 31, 2024
1 parent 380b9dc commit 3e494dc
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 3e494dc

Please sign in to comment.