Class FrameworkReplies

java.lang.Object
com.ultikits.ultitools.command.engine.FrameworkReplies

final class FrameworkReplies extends Object
Shared framework replies for Paper-retained callbacks and unavailable-literal syntax events.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static interface 
     
    private static final record 
     
    private static final record 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BaseCommandExecutor
     
    private final com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
     
     
    private final ThreadLocal<Boolean>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FrameworkReplies(BaseCommandExecutor executor, com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> original, FrameworkReplies.Redispatch redispatch)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addFallback(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, com.mojang.brigadier.builder.ArgumentBuilder<io.papermc.paper.command.brigadier.CommandSourceStack, ?> builder)
     
    private static FrameworkReplies.Step
    argument(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, ?> node, com.mojang.brigadier.StringReader reader, io.papermc.paper.command.brigadier.CommandSourceStack source)
     
    private static Arg
    argumentError(com.mojang.brigadier.Message message)
     
    private void
    collectOwnUsage(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source, Set<String> usages)
     
    private void
    collectUsages(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source, Set<String> usages)
     
    private static boolean
    customParser(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, ?> node)
     
    private com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    decorate(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, boolean root)
     
    private <T> com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    decorateArgument(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, T> node, com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack> body, boolean replyOnly)
     
    private int
    execute(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack> body, boolean replyOnly)
     
    private static boolean
    greedy(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node)
     
    private int
    invocationFailure(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.exceptions.CommandSyntaxException failure)
     
    private static com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    literal(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> parent, String token)
     
    private boolean
    needsRewrite(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context)
    Ordinary successful argument paths are not parsed again.
    private static FrameworkReplies.Step
    next(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> parent, com.mojang.brigadier.StringReader reader, io.papermc.paper.command.brigadier.CommandSourceStack source)
     
    private int
    redispatchCanonical(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk)
     
    private int
    reply(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context)
     
    (package private) int
    reply(String input, io.papermc.paper.command.brigadier.CommandSourceStack source)
     
    private static void
    sendArgumentError(org.bukkit.command.CommandSender sender, com.mojang.brigadier.Message message)
     
    private void
    sendReply(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk)
     
    private void
    sendUsages(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk, org.bukkit.command.CommandSender sender)
     
    private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
    suggestFromTree(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
     
    private static String
    token(com.mojang.brigadier.StringReader reader)
     
    (package private) com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
     
    (package private) boolean
    unavailableLiteral(String input, io.papermc.paper.command.brigadier.CommandSourceStack source)
    A syntax failure is ours only when a usable prefix reaches an unavailable literal.
    private static com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    visibleCopy(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source)
     
    walk(String input, io.papermc.paper.command.brigadier.CommandSourceStack source)
    The recovery walk uses the compiled tree's argument parsers and preserves quoted/greedy argument contents.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • tree

      com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree()
    • decorate

      private com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> decorate(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, boolean root)
    • decorateArgument

      private <T> com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> decorateArgument(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, T> node, com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack> body, boolean replyOnly)
    • addFallback

      private void addFallback(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, com.mojang.brigadier.builder.ArgumentBuilder<io.papermc.paper.command.brigadier.CommandSourceStack, ?> builder)
    • execute

      private int execute(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack> body, boolean replyOnly) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • needsRewrite

      private boolean needsRewrite(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context)
      Ordinary successful argument paths are not parsed again. Only a competing literal or fallback needs a walk.
    • suggestFromTree

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestFromTree(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
    • visibleCopy

      private static com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> visibleCopy(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source)
    • greedy

      private static boolean greedy(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node)
    • invocationFailure

      private int invocationFailure(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, com.mojang.brigadier.exceptions.CommandSyntaxException failure) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • reply

      int reply(String input, io.papermc.paper.command.brigadier.CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • reply

      private int reply(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • unavailableLiteral

      boolean unavailableLiteral(String input, io.papermc.paper.command.brigadier.CommandSourceStack source)
      A syntax failure is ours only when a usable prefix reaches an unavailable literal.
    • redispatchCanonical

      private int redispatchCanonical(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • sendReply

      private void sendReply(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk)
    • sendUsages

      private void sendUsages(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, FrameworkReplies.Walk walk, org.bukkit.command.CommandSender sender)
    • sendArgumentError

      private static void sendArgumentError(org.bukkit.command.CommandSender sender, com.mojang.brigadier.Message message)
    • argumentError

      private static Arg argumentError(com.mojang.brigadier.Message message)
    • walk

      private FrameworkReplies.Walk walk(String input, io.papermc.paper.command.brigadier.CommandSourceStack source)
      The recovery walk uses the compiled tree's argument parsers and preserves quoted/greedy argument contents.
    • next

      private static FrameworkReplies.Step next(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> parent, com.mojang.brigadier.StringReader reader, io.papermc.paper.command.brigadier.CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • argument

      private static FrameworkReplies.Step argument(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, ?> node, com.mojang.brigadier.StringReader reader, io.papermc.paper.command.brigadier.CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • customParser

      private static boolean customParser(com.mojang.brigadier.tree.ArgumentCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack, ?> node)
    • token

      private static String token(com.mojang.brigadier.StringReader reader)
    • literal

      private static com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> literal(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> parent, String token)
    • collectUsages

      private void collectUsages(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source, Set<String> usages)
    • collectOwnUsage

      private void collectOwnUsage(com.mojang.brigadier.tree.CommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> node, io.papermc.paper.command.brigadier.CommandSourceStack source, Set<String> usages)