package top.r3944realms.lib39.core.command;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.commands.CommandBuildContext;
import net.minecraft.commands.CommandSourceStack;

/**
 * The type Simple help command.
 */
public abstract class SimpleHelpCommand implements IHelpCommand {
    /**
     * The Root.
     */
    protected final LiteralArgumentBuilder<CommandSourceStack> root;

    /**
     * <pre>
     * 需要{@link CommandDispatcher<CommandSourceStack> 指令注册调度器} 和 {@link CommandBuildContext 指令上下文}
     * </pre>
     * Instantiates a new Simple help command.
     *
     * @param dispatcher the dispatcher
     * @param context    the context
     */
    public SimpleHelpCommand(CommandDispatcher<CommandSourceStack> dispatcher,
                                 CommandBuildContext context) {
        root = buildCommand(dispatcher, context);
    }

    /**
     * Gets root.
     *
     * @return the root
     */
    public LiteralArgumentBuilder<CommandSourceStack> getRoot() {
        return root;
    }
}
