Package org.incendo.cloud.brigadier.node
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
ConstructorsConstructorDescriptionLiteralBrigadierNodeFactory(@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 TypeMethodDescription@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.
-
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 managercommandManager- the command managerdummyContextProvider- creates the context provided when retrieving suggestionssuggestionFactory- 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:BrigadierNodeFactoryCreates a Brigadier command node.- Specified by:
createNodein interfaceBrigadierNodeFactory<C,S, com.mojang.brigadier.tree.LiteralCommandNode<S>> - Parameters:
label- the command labelcloudCommand- the cloud command to create the node fromexecutor- the Brigadier command execution handlerpermissionChecker- 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:BrigadierNodeFactoryCreates a Brigadier command node.- Specified by:
createNodein interfaceBrigadierNodeFactory<C,S, com.mojang.brigadier.tree.LiteralCommandNode<S>> - Parameters:
label- the command labelcloudCommand- the cloud commandexecutor- the Brigadier command execution handlerpermissionChecker- 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:BrigadierNodeFactoryCreates a Brigadier command node.- Specified by:
createNodein interfaceBrigadierNodeFactory<C,S, com.mojang.brigadier.tree.LiteralCommandNode<S>> - Parameters:
label- the command labelcloudCommand- the cloud commandexecutor- the Brigadier command execution handler- Returns:
- the created command node
-