From 187acc91955aca00f0180e9d31c7f4394becf9c8 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 17 Jun 2024 16:45:17 +0100 Subject: [PATCH] fix: adjust signature of mixin constructor redirect --- .../uniform/fabric/mixins/ArgumentNodeMixin.java | 9 +++++---- .../uniform/fabric/mixins/ArgumentNodeMixin.java | 9 +++++---- gradle.properties | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fabric-1.20.1/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java b/fabric-1.20.1/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java index dd6e499..309b4dc 100644 --- a/fabric-1.20.1/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java +++ b/fabric-1.20.1/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java @@ -39,17 +39,18 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class ArgumentNodeMixin { @Invoker("") - private static ArgumentNode createArgumentNode(String name, ArgumentSerializer.ArgumentTypeProperties properties, @Nullable Identifier id) { + private static ArgumentNode createArgumentNode(String name, ArgumentSerializer.ArgumentTypeProperties properties, + @Nullable Identifier id) { throw new AssertionError(); } @Redirect(method = "(Lcom/mojang/brigadier/tree/ArgumentCommandNode;)V", at = @At("HEAD")) - private static ArgumentNode onConstruct(ArgumentCommandNode node) { + private static ArgumentNode onConstruct(ArgumentCommandNode node) { ArgumentSerializer.ArgumentTypeProperties properties; try { - properties = ArgumentTypes.get(node.getType()).getArgumentTypeProperties(node.getType()); + properties = ArgumentTypes.getArgumentTypeProperties(node.getType()); } catch (IllegalArgumentException e) { - properties = ArgumentTypes.get(StringArgumentType.string()).getArgumentTypeProperties(StringArgumentType.string()); + properties = ArgumentTypes.getArgumentTypeProperties(StringArgumentType.string()); } return createArgumentNode( diff --git a/fabric-1.20.6/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java b/fabric-1.20.6/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java index dd6e499..309b4dc 100644 --- a/fabric-1.20.6/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java +++ b/fabric-1.20.6/src/main/java/net/william278/uniform/fabric/mixins/ArgumentNodeMixin.java @@ -39,17 +39,18 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class ArgumentNodeMixin { @Invoker("") - private static ArgumentNode createArgumentNode(String name, ArgumentSerializer.ArgumentTypeProperties properties, @Nullable Identifier id) { + private static ArgumentNode createArgumentNode(String name, ArgumentSerializer.ArgumentTypeProperties properties, + @Nullable Identifier id) { throw new AssertionError(); } @Redirect(method = "(Lcom/mojang/brigadier/tree/ArgumentCommandNode;)V", at = @At("HEAD")) - private static ArgumentNode onConstruct(ArgumentCommandNode node) { + private static ArgumentNode onConstruct(ArgumentCommandNode node) { ArgumentSerializer.ArgumentTypeProperties properties; try { - properties = ArgumentTypes.get(node.getType()).getArgumentTypeProperties(node.getType()); + properties = ArgumentTypes.getArgumentTypeProperties(node.getType()); } catch (IllegalArgumentException e) { - properties = ArgumentTypes.get(StringArgumentType.string()).getArgumentTypeProperties(StringArgumentType.string()); + properties = ArgumentTypes.getArgumentTypeProperties(StringArgumentType.string()); } return createArgumentNode( diff --git a/gradle.properties b/gradle.properties index 3482bf1..b3c6038 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ javaVersion=17 org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.daemon=true -library_version=1.0.11 +library_version=1.0.12 library_archive=uniform library_description=Cross-platform wrapper for making Brigadier commands, based on BrigadierWrapper by Tofaa2, itself inspired by emortalmcs command system. \ No newline at end of file