Skip to content

Commit

Permalink
Fix #458
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Dec 9, 2023
1 parent 68f3934 commit a69b6b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@Mixin(Commands.class)
public class MixinCommands {
@ModifyVariable(method = "finishParsing",
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V", remap = false), argsOnly = true)
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V"), argsOnly = true)
private static ParseResults<CommandSourceStack> finishParsing(ParseResults<CommandSourceStack> results) {
var event = new CommandPerformEvent(results, null);
if (CommandPerformEvent.EVENT.invoker().act(event).isPresent()) {
Expand All @@ -47,7 +47,7 @@ private static ParseResults<CommandSourceStack> finishParsing(ParseResults<Comma
}

@Inject(method = "finishParsing",
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V", remap = false), cancellable = true)
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V"), cancellable = true)
private static void finishParsing(ParseResults<CommandSourceStack> results, String command, CommandSourceStack stack, CallbackInfoReturnable<ContextChain<CommandSourceStack>> cir) {
if (results == null) cir.setReturnValue(null);
}
Expand Down

0 comments on commit a69b6b2

Please sign in to comment.