Class LiteralBrigadierNodeFactory<C,S>

java.lang.Object
org.incendo.cloud.brigadier.node.LiteralBrigadierNodeFactory<C,S>
All Implemented Interfaces:
BrigadierNodeFactory<C,S,com.mojang.brigadier.tree.LiteralCommandNode<S>>

@API(status=STABLE, since="2.0.0") public final class LiteralBrigadierNodeFactory<C,S> extends Object implements BrigadierNodeFactory<C,S,com.mojang.brigadier.tree.LiteralCommandNode<S>>
  • Constructor Summary

    Constructors
    Constructor
    Description
    LiteralBrigadierNodeFactory(@NonNull CloudBrigadierManager<C,S> cloudBrigadierManager, @NonNull org.incendo.cloud.CommandManager<C> commandManager, @NonNull Supplier<org.incendo.cloud.context.CommandContext<C>> dummyContextProvider, @NonNull org.incendo.cloud.suggestion.SuggestionFactory<C,? extends TooltipSuggestion> suggestionFactory)
    Creates a new factory that produces literal command nodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S>
    createNode(@NonNull String label, @NonNull org.incendo.cloud.Command<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor)
    Creates a Brigadier command node.
    @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S>
    createNode(@NonNull String label, @NonNull org.incendo.cloud.Command<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor, @NonNull BrigadierPermissionChecker<C> permissionChecker)
    Creates a Brigadier command node.
    @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S>
    createNode(@NonNull String label, @NonNull org.incendo.cloud.internal.CommandNode<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor, @NonNull BrigadierPermissionChecker<C> permissionChecker)
    Creates a Brigadier command node.

    Methods inherited from class java.lang.Object

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

    • LiteralBrigadierNodeFactory

      public LiteralBrigadierNodeFactory(@NonNull CloudBrigadierManager<C,S> cloudBrigadierManager, @NonNull org.incendo.cloud.CommandManager<C> commandManager, @NonNull Supplier<org.incendo.cloud.context.CommandContext<C>> dummyContextProvider, @NonNull org.incendo.cloud.suggestion.SuggestionFactory<C,? extends TooltipSuggestion> suggestionFactory)
      Creates a new factory that produces literal command nodes.
      Parameters:
      cloudBrigadierManager - the brigadier manager
      commandManager - the command manager
      dummyContextProvider - creates the context provided when retrieving suggestions
      suggestionFactory - the suggestion factory-producing tooltip suggestions
  • Method Details

    • createNode

      public @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S> createNode(@NonNull String label, @NonNull org.incendo.cloud.internal.CommandNode<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor, @NonNull BrigadierPermissionChecker<C> permissionChecker)
      Description copied from interface: BrigadierNodeFactory
      Creates a Brigadier command node.
      Specified by:
      createNode in interface BrigadierNodeFactory<C,S,com.mojang.brigadier.tree.LiteralCommandNode<S>>
      Parameters:
      label - the command label
      cloudCommand - the cloud command to create the node from
      executor - the Brigadier command execution handler
      permissionChecker - function that determines whether a sender has access to the command
      Returns:
      the created command node
    • createNode

      public @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S> createNode(@NonNull String label, @NonNull org.incendo.cloud.Command<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor, @NonNull BrigadierPermissionChecker<C> permissionChecker)
      Description copied from interface: BrigadierNodeFactory
      Creates a Brigadier command node.
      Specified by:
      createNode in interface BrigadierNodeFactory<C,S,com.mojang.brigadier.tree.LiteralCommandNode<S>>
      Parameters:
      label - the command label
      cloudCommand - the cloud command
      executor - the Brigadier command execution handler
      permissionChecker - function that determines whether a sender has access to the command
      Returns:
      the created command node
    • createNode

      public @NonNull com.mojang.brigadier.tree.LiteralCommandNode<S> createNode(@NonNull String label, @NonNull org.incendo.cloud.Command<C> cloudCommand, @NonNull com.mojang.brigadier.Command<S> executor)
      Description copied from interface: BrigadierNodeFactory
      Creates a Brigadier command node.
      Specified by:
      createNode in interface BrigadierNodeFactory<C,S,com.mojang.brigadier.tree.LiteralCommandNode<S>>
      Parameters:
      label - the command label
      cloudCommand - the cloud command
      executor - the Brigadier command execution handler
      Returns:
      the created command node