diff options
Diffstat (limited to 'patches/server/0965-Brigadier-based-command-API.patch')
-rw-r--r-- | patches/server/0965-Brigadier-based-command-API.patch | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/patches/server/0965-Brigadier-based-command-API.patch b/patches/server/0965-Brigadier-based-command-API.patch index d93978b6d2..997c10e4b7 100644 --- a/patches/server/0965-Brigadier-based-command-API.patch +++ b/patches/server/0965-Brigadier-based-command-API.patch @@ -1045,7 +1045,7 @@ index 0000000000000000000000000000000000000000..895addef908e09d527e4bc9210599e88 +} diff --git a/src/main/java/io/papermc/paper/command/brigadier/argument/SignedMessageResolverImpl.java b/src/main/java/io/papermc/paper/command/brigadier/argument/SignedMessageResolverImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..72966584089d3fee9778f572727c9b7f4a4d4302 +index 0000000000000000000000000000000000000000..07a23be2cd7b4592108dee0ae223e71b1d00cec9 --- /dev/null +++ b/src/main/java/io/papermc/paper/command/brigadier/argument/SignedMessageResolverImpl.java @@ -0,0 +1,30 @@ @@ -1053,13 +1053,13 @@ index 0000000000000000000000000000000000000000..72966584089d3fee9778f572727c9b7f + +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; ++import java.util.concurrent.CompletableFuture; +import net.kyori.adventure.chat.SignedMessage; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.arguments.MessageArgument; -+import org.jetbrains.annotations.NotNull; -+ -+import java.util.concurrent.CompletableFuture; ++import org.jspecify.annotations.NullMarked; + ++@NullMarked +public record SignedMessageResolverImpl(MessageArgument.Message message) implements SignedMessageResolver { + + @Override @@ -1067,13 +1067,13 @@ index 0000000000000000000000000000000000000000..72966584089d3fee9778f572727c9b7f + return this.message.text(); + } + ++ @SuppressWarnings({"rawtypes", "unchecked"}) + @Override -+ public @NotNull CompletableFuture<SignedMessage> resolveSignedMessage(final String argumentName, final CommandContext erased) throws CommandSyntaxException { -+ final CommandContext<CommandSourceStack> type = erased; ++ public CompletableFuture<SignedMessage> resolveSignedMessage(final String argumentName, final CommandContext erased) throws CommandSyntaxException { + final CompletableFuture<SignedMessage> future = new CompletableFuture<>(); + -+ final MessageArgument.Message response = type.getArgument(argumentName, SignedMessageResolverImpl.class).message; -+ MessageArgument.resolveChatMessage(response, type, argumentName, (message) -> { ++ final MessageArgument.Message response = ((CommandContext<CommandSourceStack>) erased).getArgument(argumentName, SignedMessageResolverImpl.class).message; ++ MessageArgument.resolveChatMessage(response, erased, argumentName, (message) -> { + future.complete(message.adventureView()); + }); + return future; |