Skip to content

Commit

Permalink
Updated to 23w42a
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <[email protected]>
  • Loading branch information
shedaniel committed Oct 19, 2023
1 parent c0d6cb9 commit 98f357d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@

import com.google.common.base.Throwables;
import com.mojang.brigadier.ParseResults;
import com.mojang.brigadier.context.ContextChain;
import dev.architectury.event.events.common.CommandPerformEvent;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(Commands.class)
public class MixinCommands {
@ModifyVariable(method = "performCommand",
@ModifyVariable(method = "finishParsing",
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V", remap = false), argsOnly = true)
private ParseResults<CommandSourceStack> performCommand(ParseResults<CommandSourceStack> results) {
private static ParseResults<CommandSourceStack> finishParsing(ParseResults<CommandSourceStack> results) {
var event = new CommandPerformEvent(results, null);
if (CommandPerformEvent.EVENT.invoker().act(event).isPresent()) {
if (event.getThrowable() != null) {
Expand All @@ -45,9 +46,9 @@ private ParseResults<CommandSourceStack> performCommand(ParseResults<CommandSour
return event.getResults();
}

@Inject(method = "performCommand",
@Inject(method = "finishParsing",
at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;validateParseResults(Lcom/mojang/brigadier/ParseResults;)V", remap = false), cancellable = true)
private void performCommand(ParseResults<CommandSourceStack> results, String command, CallbackInfo ci) {
if (results == null) ci.cancel();
private static void finishParsing(ParseResults<CommandSourceStack> results, String command, CommandSourceStack stack, CallbackInfoReturnable<ContextChain<CommandSourceStack>> cir) {
if (results == null) cir.setReturnValue(null);
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.daemon=false

platforms=fabric

minecraft_version=23w41a
supported_version=23w41a
minecraft_version=23w42a
supported_version=23w42a

artifact_type=beta

Expand All @@ -14,7 +14,7 @@ base_version=11.0
maven_group=dev.architectury

fabric_loader_version=0.14.23
fabric_api_version=0.90.1+1.20.3
fabric_api_version=0.90.3+1.20.3
mod_menu_version=7.0.0

forge_version=48.0.1
Expand Down

0 comments on commit 98f357d

Please sign in to comment.